Java Code Examples for org.eclipse.gef.EditPart#SELECTED
The following examples show how to use
org.eclipse.gef.EditPart#SELECTED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NormalColumnEditPart.java From ermasterr with Apache License 2.0 | 6 votes |
private List<NormalColumn> getSelectedForeignKeyColulmnList() { final List<NormalColumn> foreignKeyColulmnList = new ArrayList<NormalColumn>(); final TableViewEditPart parent = (TableViewEditPart) getParent(); for (final Object object : parent.getTargetConnections()) { final ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; final int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { final ConnectionElement connectionElement = (ConnectionElement) connectionEditPart.getModel(); if (connectionElement instanceof Relation) { final Relation relation = (Relation) connectionElement; foreignKeyColulmnList.addAll(relation.getForeignKeyColumns()); } } } return foreignKeyColulmnList; }
Example 2
Source File: NormalColumnEditPart.java From erflute with Apache License 2.0 | 6 votes |
private List<NormalColumn> getSelectedForeignKeyColulmnList() { final List<NormalColumn> foreignKeyColulmnList = new ArrayList<>(); final TableViewEditPart parent = (TableViewEditPart) getParent(); for (final Object object : parent.getTargetConnections()) { final ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; final int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { final WalkerConnection connectionElement = (WalkerConnection) connectionEditPart.getModel(); if (connectionElement instanceof Relationship) { final Relationship relation = (Relationship) connectionElement; foreignKeyColulmnList.addAll(relation.getForeignKeyColumns()); } } } return foreignKeyColulmnList; }
Example 3
Source File: NormalColumnEditPart.java From ermaster-b with Apache License 2.0 | 6 votes |
private List<NormalColumn> getSelectedForeignKeyColulmnList() { List<NormalColumn> foreignKeyColulmnList = new ArrayList<NormalColumn>(); TableViewEditPart parent = (TableViewEditPart) this.getParent(); for (Object object : parent.getTargetConnections()) { ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { ConnectionElement connectionElement = (ConnectionElement) connectionEditPart .getModel(); if (connectionElement instanceof Relation) { Relation relation = (Relation) connectionElement; foreignKeyColulmnList.addAll(relation .getForeignKeyColumns()); } } } return foreignKeyColulmnList; }
Example 4
Source File: NormalColumnEditPart.java From ermasterr with Apache License 2.0 | 5 votes |
private List<NormalColumn> getSelectedReferencedColulmnList() { final List<NormalColumn> referencedColulmnList = new ArrayList<NormalColumn>(); final TableViewEditPart parent = (TableViewEditPart) getParent(); final TableView tableView = (TableView) parent.getModel(); for (final Object object : parent.getSourceConnections()) { final ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; final int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { final ConnectionElement connectionElement = (ConnectionElement) connectionEditPart.getModel(); if (connectionElement instanceof Relation) { final Relation relation = (Relation) connectionElement; if (relation.isReferenceForPK()) { referencedColulmnList.addAll(((ERTable) tableView).getPrimaryKeys()); } else if (relation.getReferencedComplexUniqueKey() != null) { referencedColulmnList.addAll(relation.getReferencedComplexUniqueKey().getColumnList()); } else { referencedColulmnList.add(relation.getReferencedColumn()); } } } } return referencedColulmnList; }
Example 5
Source File: TransitionEditPart.java From statecharts with Eclipse Public License 1.0 | 5 votes |
@Override public void setSelected(int value) { switch (value) { case EditPart.SELECTED: case EditPart.SELECTED_PRIMARY: getFigure().setLineWidth(getMapMode().DPtoLP(2)); break; default: getFigure().setLineWidth(getMapMode().DPtoLP(1)); } super.setSelected(value); }
Example 6
Source File: NormalColumnEditPart.java From erflute with Apache License 2.0 | 5 votes |
private List<NormalColumn> getSelectedReferencedColulmnList() { final List<NormalColumn> referencedColulmnList = new ArrayList<>(); final TableViewEditPart parent = (TableViewEditPart) getParent(); final TableView tableView = (TableView) parent.getModel(); for (final Object object : parent.getSourceConnections()) { final ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; final int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { final WalkerConnection connectionElement = (WalkerConnection) connectionEditPart.getModel(); if (connectionElement instanceof Relationship) { final Relationship relation = (Relationship) connectionElement; if (relation.isReferenceForPK()) { referencedColulmnList.addAll(((ERTable) tableView).getPrimaryKeys()); } else if (relation.getReferredCompoundUniqueKey() != null) { referencedColulmnList.addAll(relation.getReferredCompoundUniqueKey().getColumnList()); } else { referencedColulmnList.add(relation.getReferredSimpleUniqueColumn()); } } } } return referencedColulmnList; }
Example 7
Source File: UpdateSizeLaneSelectionEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * */ public UpdateSizeLaneSelectionEditPolicy() { figureListener = new FigureListener() { @Override public void figureMoved(final IFigure source) { hideSelection(); if(hasFocus || state == EditPart.SELECTED || state == EditPart.SELECTED_PRIMARY){ showSelection(); } } }; }
Example 8
Source File: AbstractSwitchLaneSelectionEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * */ public AbstractSwitchLaneSelectionEditPolicy() { figureListener = new FigureListener() { public void figureMoved(IFigure source) { hideSelection(); if(hasFocus || state == EditPart.SELECTED || state == EditPart.SELECTED_PRIMARY){ showSelection(); } } }; }
Example 9
Source File: SwitchPoolSelectionEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * */ public SwitchPoolSelectionEditPolicy() { figureListener = new FigureListener() { public void figureMoved(IFigure source) { hideSelection(); if(hasFocus || state == EditPart.SELECTED || state == EditPart.SELECTED_PRIMARY){ showSelection(); } } }; }
Example 10
Source File: UpdateSizePoolSelectionEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * */ public UpdateSizePoolSelectionEditPolicy() { figureListener = new FigureListener() { public void figureMoved(IFigure source) { hideSelection(); if(hasFocus || state == EditPart.SELECTED || state == EditPart.SELECTED_PRIMARY){ showSelection(); } } }; }
Example 11
Source File: NormalColumnEditPart.java From ermaster-b with Apache License 2.0 | 5 votes |
private List<NormalColumn> getSelectedReferencedColulmnList() { List<NormalColumn> referencedColulmnList = new ArrayList<NormalColumn>(); TableViewEditPart parent = (TableViewEditPart) this.getParent(); TableView tableView = (TableView) parent.getModel(); for (Object object : parent.getSourceConnections()) { ConnectionEditPart connectionEditPart = (ConnectionEditPart) object; int selected = connectionEditPart.getSelected(); if (selected == EditPart.SELECTED || selected == EditPart.SELECTED_PRIMARY) { ConnectionElement connectionElement = (ConnectionElement) connectionEditPart .getModel(); if (connectionElement instanceof Relation) { Relation relation = (Relation) connectionElement; if (relation.isReferenceForPK()) { referencedColulmnList.addAll(((ERTable) tableView) .getPrimaryKeys()); } else if (relation.getReferencedComplexUniqueKey() != null) { referencedColulmnList.addAll(relation .getReferencedComplexUniqueKey() .getColumnList()); } else { referencedColulmnList.add(relation .getReferencedColumn()); } } } } return referencedColulmnList; }
Example 12
Source File: AbstractSwitchLaneSelectionEditPolicy.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public void zoomChanged(double zoom) { hideSelection(); if(hasFocus || state == EditPart.SELECTED){ showSelection(); } }