Search in sources :

Example 6 with RangeModel

use of org.eclipse.draw2d.RangeModel in project archi by archimatetool.

the class DrawerEditPart method restoreState.

/**
 * @see org.eclipse.gef.ui.palette.editparts.PaletteEditPart#restoreState(org.eclipse.ui.IMemento)
 */
@SuppressWarnings("deprecation")
@Override
public void restoreState(IMemento memento) {
    setExpanded(new Boolean(memento.getString(PROPERTY_EXPANSION_STATE)).booleanValue());
    setPinnedOpen(new Boolean(memento.getString(PROPERTY_PINNED_STATE)).booleanValue());
    RangeModel rModel = getDrawerFigure().getScrollpane().getViewport().getVerticalRangeModel();
    rModel.setMinimum(memento.getInteger(RangeModel.PROPERTY_MINIMUM).intValue());
    rModel.setMaximum(memento.getInteger(RangeModel.PROPERTY_MAXIMUM).intValue());
    rModel.setExtent(memento.getInteger(RangeModel.PROPERTY_EXTENT).intValue());
    rModel.setValue(memento.getInteger(RangeModel.PROPERTY_VALUE).intValue());
    super.restoreState(memento);
}
Also used : RangeModel(org.eclipse.draw2d.RangeModel)

Example 7 with RangeModel

use of org.eclipse.draw2d.RangeModel in project archi by archimatetool.

the class DrawerEditPart method saveState.

/**
 * @see org.eclipse.gef.ui.palette.editparts.PaletteEditPart#saveState(org.eclipse.ui.IMemento)
 */
@SuppressWarnings("deprecation")
@Override
public void saveState(IMemento memento) {
    memento.putString(PROPERTY_EXPANSION_STATE, new Boolean(isExpanded()).toString());
    memento.putString(PROPERTY_PINNED_STATE, new Boolean(isPinnedOpen()).toString());
    RangeModel rModel = getDrawerFigure().getScrollpane().getViewport().getVerticalRangeModel();
    memento.putInteger(RangeModel.PROPERTY_MINIMUM, rModel.getMinimum());
    memento.putInteger(RangeModel.PROPERTY_MAXIMUM, rModel.getMaximum());
    memento.putInteger(RangeModel.PROPERTY_EXTENT, rModel.getExtent());
    memento.putInteger(RangeModel.PROPERTY_VALUE, rModel.getValue());
    super.saveState(memento);
}
Also used : RangeModel(org.eclipse.draw2d.RangeModel)

Aggregations

RangeModel (org.eclipse.draw2d.RangeModel)7 Viewport (org.eclipse.draw2d.Viewport)3 Point (org.eclipse.draw2d.geometry.Point)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 DefaultRangeModel (org.eclipse.draw2d.DefaultRangeModel)1 FigureCanvas (org.eclipse.draw2d.FigureCanvas)1 ScrollBar (org.eclipse.draw2d.ScrollBar)1 ScrollBarLayout (org.eclipse.draw2d.ScrollBarLayout)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1 Insets (org.eclipse.draw2d.geometry.Insets)1