org.eclipse.gef.internal.ui.rulers.GuideEditPart Java Examples

The following examples show how to use org.eclipse.gef.internal.ui.rulers.GuideEditPart. 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: IndexEditPart.java    From erflute with Apache License 2.0 5 votes vote down vote up
public void refreshTableColumns() {
    final ERDiagram diagram = getDiagram();
    final IndexFigure indexFigure = (IndexFigure) getFigure();
    final ERIndex index = (ERIndex) getModel();
    final int notationLevel = diagram.getDiagramContents().getSettings().getNotationLevel();

    final TableViewEditPart parent = (TableViewEditPart) getParent();
    final List<?> figures = parent.getContentPane().getChildren();
    boolean isFirst = false;
    if (!(figures.get(figures.size() - 1) instanceof IndexFigure)) {
        if (notationLevel != DiagramSettings.NOTATION_LEVLE_TITLE) {
            isFirst = true;
            parent.getContentPane().add(new GuideEditPart.GuideLineFigure());
            final Label indexHeader = new Label();
            indexHeader.setLabelAlignment(PositionConstants.LEFT);
            indexHeader.setText("<< index >>");
            indexHeader.setBorder(new MarginBorder(new Insets(4, 3, 0, 0)));

            parent.getContentPane().add(indexHeader);
        }
    }
    parent.getContentPane().add(figure);
    if (notationLevel != DiagramSettings.NOTATION_LEVLE_TITLE) {
        final TableFigure tableFigure = (TableFigure) parent.getFigure();

        addColumnFigure(diagram, tableFigure, indexFigure, index, isFirst, false);

        if (selected) {
            indexFigure.setBackgroundColor(ColorConstants.titleBackground);
            indexFigure.setForegroundColor(ColorConstants.titleForeground);
        }
    } else {
        indexFigure.clearLabel();
        return;
    }
}
 
Example #2
Source File: MultipleShapesHorizontalMoveTool.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Default constructor, with no args as required
 * by the palette.
 */
public MultipleShapesHorizontalMoveTool() {
	guideline = new GuideEditPart.GuideLineFigure();
	guideline.setVisible(false);
}
 
Example #3
Source File: MultipleShapesVerticalMoveTool.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Default constructor, with no args as required
 * by the palette.
 */
public MultipleShapesVerticalMoveTool() {
	guideline = new GuideEditPart.GuideLineFigure();
	guideline.setVisible(false);
}
 
Example #4
Source File: IndexEditPart.java    From ermaster-b with Apache License 2.0 4 votes vote down vote up
public void refreshTableColumns(UpdatedNodeElement updated) {
		ERDiagram diagram = this.getDiagram();

		IndexFigure indexFigure = (IndexFigure) this.getFigure();

		Index index = (Index) this.getModel();

		if (diagram.isShowMainColumn()) {
			// �C���f�b�N�X�͏�ɕ\��
		}

		int notationLevel = diagram.getDiagramContents().getSettings().getNotationLevel();

		TableViewEditPart parent = (TableViewEditPart) this.getParent();
		List figures = parent.getContentPane().getChildren();
		boolean isFirst = false;
		if (! (figures.get(figures.size() - 1) instanceof IndexFigure)) {
			// Index �̐擪�̓{�[�_�[��t����
			if (notationLevel != Settings.NOTATION_LEVLE_TITLE) {
				isFirst = true;
				parent.getContentPane().add(new GuideEditPart.GuideLineFigure());
				Label indexHeader = new Label();
				indexHeader.setLabelAlignment(PositionConstants.LEFT);
				indexHeader.setText("<< index >>");
				indexHeader.setBorder(new MarginBorder(new Insets(4, 3, 0, 0)));

				parent.getContentPane().add(indexHeader);
			}
		}
		parent.getContentPane().add(figure);

		if (notationLevel != Settings.NOTATION_LEVLE_TITLE) {
			TableFigure tableFigure = (TableFigure) parent.getFigure();

//			List<NormalColumn> selectedReferencedColulmnList = this
//					.getSelectedReferencedColulmnList();
//			List<NormalColumn> selectedForeignKeyColulmnList = this
//					.getSelectedForeignKeyColulmnList();
//
//			boolean isSelectedReferenced = selectedReferencedColulmnList
//					.contains(index);
//			boolean isSelectedForeignKey = selectedForeignKeyColulmnList
//					.contains(index);
//
//			boolean isAdded = false;
//			boolean isUpdated = false;
//			if (updated != null) {
//				isAdded = updated.isAdded(index);
//				isUpdated = updated.isUpdated(index);
//			}
//
//			if ((notationLevel == Settings.NOTATION_LEVLE_KEY)
//					&& !index.isPrimaryKey()
//					&& !index.isForeignKey()
//					&& !index.isReferedStrictly()) {
//				indexFigure.clearLabel();
//				return;
//			}

			addColumnFigure(diagram, tableFigure, indexFigure, index,
					isFirst,
					/* isSelectedReferenced, isSelectedForeignKey, isAdded, isUpdated, */
					false);

			if (selected) {
				indexFigure.setBackgroundColor(ColorConstants.titleBackground);
				indexFigure.setForegroundColor(ColorConstants.titleForeground);
			}

		} else {
			indexFigure.clearLabel();
			return;
		}
	}