Search in sources :

Example 6 with EntityFigure

use of org.jkiss.dbeaver.ext.erd.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method refreshVisuals.

/**
	 * Reset the layout constraint, and revalidate the content pane
	 */
@Override
protected void refreshVisuals() {
    EntityFigure entityFigure = getFigure();
    Point location = entityFigure.getLocation();
    DiagramPart parent = (DiagramPart) getParent();
    Rectangle constraint = new Rectangle(location.x, location.y, -1, -1);
    parent.setLayoutConstraint(this, entityFigure, constraint);
}
Also used : EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Point(org.eclipse.draw2d.geometry.Point)

Example 7 with EntityFigure

use of org.jkiss.dbeaver.ext.erd.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method commitNameChange.

//******************* Listener related methods *********************/
/**
	 * Handles change in name when committing a direct edit
	 */
@Override
protected void commitNameChange(PropertyChangeEvent evt) {
    EntityFigure entityFigure = getFigure();
    EditableLabel label = entityFigure.getNameLabel();
    label.setText(getTable().getObject().getName());
    label.setVisible(true);
    refreshVisuals();
}
Also used : EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure)

Example 8 with EntityFigure

use of org.jkiss.dbeaver.ext.erd.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method performDirectEdit.

protected void performDirectEdit() {
    if (manager == null) {
        ERDGraphicalViewer viewer = getViewer();
        ValidationMessageHandler handler = viewer.getValidationHandler();
        EntityFigure figure = getFigure();
        EditableLabel nameLabel = figure.getNameLabel();
        manager = new ExtendedDirectEditManager(this, TextCellEditor.class, new LabelCellEditorLocator(nameLabel), nameLabel, new TableNameCellEditorValidator(handler));
    }
    manager.show();
}
Also used : EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure) ExtendedDirectEditManager(org.jkiss.dbeaver.ext.erd.directedit.ExtendedDirectEditManager) LabelCellEditorLocator(org.jkiss.dbeaver.ext.erd.directedit.LabelCellEditorLocator) ValidationMessageHandler(org.jkiss.dbeaver.ext.erd.directedit.ValidationMessageHandler) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TableNameCellEditorValidator(org.jkiss.dbeaver.ext.erd.directedit.TableNameCellEditorValidator) ERDGraphicalViewer(org.jkiss.dbeaver.ext.erd.editor.ERDGraphicalViewer)

Example 9 with EntityFigure

use of org.jkiss.dbeaver.ext.erd.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method setSelected.

/**
	 * Sets the width of the line when selected
	 */
@Override
public void setSelected(int value) {
    super.setSelected(value);
    EntityFigure entityFigure = getFigure();
    if (value != EditPart.SELECTED_NONE)
        entityFigure.setSelected(true);
    else
        entityFigure.setSelected(false);
    entityFigure.repaint();
}
Also used : EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure)

Aggregations

EntityFigure (org.jkiss.dbeaver.ext.erd.figures.EntityFigure)9 EditableLabel (org.jkiss.dbeaver.ext.erd.figures.EditableLabel)5 Rectangle (org.eclipse.draw2d.geometry.Rectangle)3 ERDEntity (org.jkiss.dbeaver.ext.erd.model.ERDEntity)2 FileOutputStream (java.io.FileOutputStream)1 HashMap (java.util.HashMap)1 Bendpoint (org.eclipse.draw2d.Bendpoint)1 Point (org.eclipse.draw2d.geometry.Point)1 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)1 ExtendedDirectEditManager (org.jkiss.dbeaver.ext.erd.directedit.ExtendedDirectEditManager)1 LabelCellEditorLocator (org.jkiss.dbeaver.ext.erd.directedit.LabelCellEditorLocator)1 TableNameCellEditorValidator (org.jkiss.dbeaver.ext.erd.directedit.TableNameCellEditorValidator)1 ValidationMessageHandler (org.jkiss.dbeaver.ext.erd.directedit.ValidationMessageHandler)1 ERDGraphicalViewer (org.jkiss.dbeaver.ext.erd.editor.ERDGraphicalViewer)1 AttributeListFigure (org.jkiss.dbeaver.ext.erd.figures.AttributeListFigure)1 ERDAssociation (org.jkiss.dbeaver.ext.erd.model.ERDAssociation)1 ERDEntityAttribute (org.jkiss.dbeaver.ext.erd.model.ERDEntityAttribute)1 EntityDiagram (org.jkiss.dbeaver.ext.erd.model.EntityDiagram)1 AssociationPart (org.jkiss.dbeaver.ext.erd.part.AssociationPart)1 EntityPart (org.jkiss.dbeaver.ext.erd.part.EntityPart)1