Search in sources :

Example 6 with AnimableRunnable

use of org.whole.lang.ui.util.AnimableRunnable in project whole by wholeplatform.

the class LiteralTerminalPart method setDetailed.

@Override
public void setDetailed(boolean value, IEntityPart childPart) {
    if (isDetailed() == value)
        return;
    super.setDetailed(value, childPart);
    IEntityLayout lm = (IEntityLayout) getFigure().getLayoutManager();
    lm.setSpacedChild(value ? IEntityLayout.SPACED_ALL : IEntityLayout.SPACED_NONE);
    new AnimableRunnable() {

        public void doRun() {
            getFigure().revalidate();
            getFigure().repaint();
        }
    }.syncExec();
}
Also used : IEntityLayout(org.whole.lang.ui.layout.IEntityLayout) AnimableRunnable(org.whole.lang.ui.util.AnimableRunnable)

Example 7 with AnimableRunnable

use of org.whole.lang.ui.util.AnimableRunnable in project whole by wholeplatform.

the class AbstractPart method propertyChange.

/**
 * Handles changes in properties of this. It is
 * activated through the PropertyChangeListener.
 * It updates children, source and target connections,
 * and the visuals of this based on the property
 * changed.
 *
 * @param evt  Event which details the property change.
 */
public final void propertyChange(final PropertyChangeEvent evt) {
    int millis = EntityUtils.isData((IEntity) evt.getSource()) ? AnimableRunnable.NO_ANIMATION : AnimableRunnable.DEFAULT_DELAY;
    AnimableRunnable runnable = new AnimableRunnable(millis) {

        public void doRun() {
            propertyChangeUI(evt);
        }
    };
    if (isSyncPropertyChange())
        runnable.syncExec();
    else
        runnable.asyncExec();
}
Also used : IEntity(org.whole.lang.model.IEntity) AnimableRunnable(org.whole.lang.ui.util.AnimableRunnable)

Example 8 with AnimableRunnable

use of org.whole.lang.ui.util.AnimableRunnable in project whole by wholeplatform.

the class AbstractCompositePart method setDetailed.

@Override
public void setDetailed(boolean value, IEntityPart childPart) {
    if (isDetailed() == value)
        return;
    super.setDetailed(value, childPart);
    IEntityLayout lm = (IEntityLayout) getFigure().getLayoutManager();
    int childIndex = getChildren().indexOf(childPart);
    lm.setSpacedChild(value ? (childIndex != -1 ? childIndex : IEntityLayout.SPACED_ALL) : IEntityLayout.SPACED_NONE);
    new AnimableRunnable() {

        public void doRun() {
            getFigure().revalidate();
            getFigure().repaint();
        }
    }.syncExec();
}
Also used : IEntityLayout(org.whole.lang.ui.layout.IEntityLayout) AnimableRunnable(org.whole.lang.ui.util.AnimableRunnable)

Aggregations

AnimableRunnable (org.whole.lang.ui.util.AnimableRunnable)8 IEntityLayout (org.whole.lang.ui.layout.IEntityLayout)6 ActionEvent (org.eclipse.draw2d.ActionEvent)1 ActionListener (org.eclipse.draw2d.ActionListener)1 IEntity (org.whole.lang.model.IEntity)1