use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class AdaptiveEntityPart method propertyChangeUI.
@Override
protected void propertyChangeUI(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("notation#rebuild")) {
rebuild();
return;
}
FeatureDescriptor fd = getModelEntity().wGetEntityDescriptor().getFeatureDescriptorEnum().valueOf(evt.getPropertyName());
if (typeFeature.equals(fd)) {
entityStyling = null;
rebuild();
return;
}
super.propertyChangeUI(evt);
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class StyledTreePartFactory method getFeaturesStyling.
public static IFeatureStyling[] getFeaturesStyling(List<FeatureDescriptor> efDescriptors) {
IFeatureStyling[] featuresStyling = new IFeatureStyling[efDescriptors.size()];
int i = 0;
for (FeatureDescriptor fd : efDescriptors) featuresStyling[i++] = new FeatureStyling(fd.getName(), !fd.getEntityDescriptor().getDataKind().isNotAData(), true, getAlignment(fd.getEntityDescriptor()));
return featuresStyling;
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class AbstractConnectionCommand method getConnectionConnectedFeature.
protected FeatureDescriptor getConnectionConnectedFeature(IEntity node) {
FeatureDescriptor fd = null;
IEntityIterator<IEntity> i = IteratorFactory.childIterator();
i.reset(node);
for (IEntity child : i) if ((EntityUtils.isComposite(child) && child.wContains(getConnection())) || (EntityUtils.isSimple(child) && child.wEquals(getConnection())))
fd = node.wGetFeatureDescriptor(child);
return fd;
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class SimpleEntityTreeFigure method createFeaturesOutline.
protected IFigure createFeaturesOutline(EntityDescriptor<?> ed, ActionListener linkListener) {
int featureNum = ed.childFeatureSize();
IFigure featuresOutline = new EntityFigure(new ColumnLayout().withAutoresizeWeight(1.0f).withMarginBottom(2).withMinorAlignment(isRightToLeft() ? Alignment.LEADING : Alignment.TRAILING));
featureToggles = new Toggle[featureNum];
for (int i = 0; i < featureNum; i++) {
FeatureDescriptor fd = ed.getEntityFeatureDescriptor(i);
EntityFigure feature = new EntityFigure(new RowLayout().withSpacing(3).withMajorAlignment(isRightToLeft() ? Alignment.LEADING : Alignment.TRAILING).withReversedChildren(isRightToLeft()));
feature.addLabel(fd.getName());
featureToggles[i] = createFoldingToggle(new EntityToggle(WholeImages.ROUND_EXPAND, WholeImages.ROUND_COLLAPSE), i);
feature.add(featureToggles[i]);
featuresOutline.add(feature);
}
for (int i = featureNum, size = ed.featureSize(); i < size; i++) {
FeatureDescriptor fd = ed.getEntityFeatureDescriptor(i);
EntityFigure feature = new EntityFigure(new RowLayout().withMarginLeft(3).withMarginRight(3).withMajorAlignment(isRightToLeft() ? Alignment.LEADING : Alignment.TRAILING).withReversedChildren(isRightToLeft()));
EntityLabel createLabel = feature.addLabel(fd.getName(), WholeImages.LINK);
createLabel.setTextPlacement(isRightToLeft() ? PositionConstants.EAST : PositionConstants.WEST);
createLabel.setBorder(new MarginBorder(3));
feature.add(new EntityButton(createLabel, linkListener, i));
featuresOutline.add(feature);
}
return featuresOutline;
}
use of org.whole.lang.reflect.FeatureDescriptor in project whole by wholeplatform.
the class ConnectionReconnectCommand method canExecute.
public boolean canExecute() {
if (!canConnect(newNode, newNodeFeature))
return false;
oldNode = getConnection().wGet(getConnectionFeature(isSourceCommand() ? "source" : "target"));
if (oldNode.equals(newNode))
return false;
IEntity otherNode = getOtherEndpoint();
FeatureDescriptor otherFeature = getConnectionConnectedFeature(otherNode);
if (isSourceCommand())
return !connectionExists(newNode, newNodeFeature, otherNode, otherFeature);
else
return !connectionExists(otherNode, otherFeature, newNode, newNodeFeature);
}
Aggregations