コード例 #1
0
  public DiagramEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
    getActionRegistry().registerAction(new UndoRetargetAction());
    getActionRegistry().registerAction(new RedoRetargetAction());
    getActionRegistry().registerAction(new DeleteRetargetAction());

    UMLPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
    ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
  }
コード例 #2
0
  protected void applyPreferences() {
    IPreferenceStore store = UMLPlugin.getDefault().getPreferenceStore();

    getGraphicalViewer()
        .setProperty(
            SnapToGrid.PROPERTY_GRID_ENABLED,
            new Boolean(store.getBoolean(UMLPlugin.PREF_SHOW_GRID)));
    getGraphicalViewer()
        .setProperty(
            SnapToGrid.PROPERTY_GRID_VISIBLE,
            new Boolean(store.getBoolean(UMLPlugin.PREF_SHOW_GRID)));

    int gridSize = store.getInt(UMLPlugin.PREF_GRID_SIZE);
    getGraphicalViewer()
        .setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(gridSize, gridSize));

    getGraphicalViewer()
        .setProperty(
            SnapToGeometry.PROPERTY_SNAP_ENABLED,
            new Boolean(store.getBoolean(UMLPlugin.PREF_SNAP_GEOMETRY)));
  }
コード例 #3
0
 public void dispose() {
   UMLPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
   ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
   super.dispose();
 }