use of org.jkiss.dbeaver.erd.ui.figures.NoteFigure in project dbeaver by serge-rider.
the class NotePart method createFigure.
// ******************* Layout related methods *********************/
/**
* Creates a figure which represents the table
*/
@Override
protected NoteFigure createFigure() {
final NoteFigure noteFigure = new NoteFigure(getNote());
EntityDiagram.NodeVisualInfo visualInfo = ((DiagramPart) getParent()).getDiagram().getVisualInfo(getNote(), true);
Rectangle bounds = visualInfo.initBounds;
if (bounds != null) {
noteFigure.setBounds(bounds);
noteFigure.setPreferredSize(bounds.getSize());
// noteFigure.setLocation(bounds.getLocation());
// noteFigure.setSize(bounds.getSize());
} else if (noteFigure.getSize().isEmpty()) {
noteFigure.setPreferredSize(new Dimension(100, 50));
}
if (visualInfo.transparent) {
noteFigure.setOpaque(false);
}
if (visualInfo.bgColor != null) {
noteFigure.setBackgroundColor(visualInfo.bgColor);
}
if (visualInfo.fgColor != null) {
noteFigure.setForegroundColor(visualInfo.fgColor);
}
if (visualInfo.borderWidth != ERDUIConstants.DEFAULT_NOTE_BORDER_WIDTH) {
noteFigure.setBorder(createBorder(visualInfo.borderWidth));
}
if (visualInfo.font != null) {
noteFigure.setFont(visualInfo.font);
}
return noteFigure;
}
use of org.jkiss.dbeaver.erd.ui.figures.NoteFigure in project dbeaver by serge-rider.
the class NotePart method performDirectEdit.
protected void performDirectEdit() {
if (manager == null) {
NoteFigure figure = (NoteFigure) getFigure();
manager = new ExtendedDirectEditManager(this, MultilineTextCellEditor.class, new FigureEditorLocator(figure), figure, value -> null);
}
manager.show();
}
use of org.jkiss.dbeaver.erd.ui.figures.NoteFigure in project dbeaver by serge-rider.
the class NotePart method revertNameChange.
/**
* Reverts to existing name in model when exiting from a direct edit
* (possibly before a commit which will result in a change in the figure
* value)
*/
public void revertNameChange() {
NoteFigure noteFigure = (NoteFigure) getFigure();
noteFigure.setText(getNote().getObject());
noteFigure.setVisible(true);
refreshVisuals();
}
use of org.jkiss.dbeaver.erd.ui.figures.NoteFigure in project dbeaver by serge-rider.
the class NotePart method directEditHitTest.
private boolean directEditHitTest(Point requestLoc) {
NoteFigure figure = (NoteFigure) getFigure();
figure.translateToRelative(requestLoc);
return figure.containsPoint(requestLoc);
}
use of org.jkiss.dbeaver.erd.ui.figures.NoteFigure in project dbeaver by dbeaver.
the class NotePart method revertNameChange.
/**
* Reverts to existing name in model when exiting from a direct edit
* (possibly before a commit which will result in a change in the figure
* value)
*/
public void revertNameChange() {
NoteFigure noteFigure = (NoteFigure) getFigure();
noteFigure.setText(getNote().getObject());
noteFigure.setVisible(true);
refreshVisuals();
}
Aggregations