Search in sources :

Example 1 with LockGraphNode

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode in project dbeaver by serge-rider.

the class LockGraphNodeEditPart method createFigure.

@Override
protected IFigure createFigure() {
    LockGraphNode node = (LockGraphNode) getModel();
    LockGraph graph = (LockGraph) getParent().getModel();
    LockGraphNodeFigure nodeFigure = new LockGraphNodeFigure(node.getTitle(), (node == graph.getSelection()));
    this.targetAnchor = new LockGraphConnectionAnchor(nodeFigure);
    this.sourceAnchor = new LockGraphConnectionAnchor(nodeFigure);
    return nodeFigure;
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph) LockGraphNode(org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode)

Example 2 with LockGraphNode

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode in project dbeaver by dbeaver.

the class LockGraphNodeEditPart method refreshVisuals.

@Override
protected void refreshVisuals() {
    LockGraphNode node = (LockGraphNode) getModel();
    LockGraph lgraph = (LockGraph) ((LockGraphEditPart) getParent()).getModel();
    LockGraphNodeFigure nodeFigure = (LockGraphNodeFigure) getFigure();
    LockGraphEditPart graph = (LockGraphEditPart) getParent();
    GridData gridData = new GridData(55, 30);
    gridData.horizontalAlignment = GridData.CENTER;
    gridData.verticalAlignment = GridData.CENTER;
    gridData.verticalSpan = 10;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    int span = lgraph.getMaxWidth() / node.getSpan();
    int spanMod = lgraph.getMaxWidth() % node.getSpan();
    gridData.horizontalSpan = 0;
    if (span > 1 && node.getLevelPosition() != LockGraphNode.LevelPosition.RIGHT) {
        gridData.horizontalSpan = span;
    } else if (spanMod > 0 && node.getLevelPosition() == LockGraphNode.LevelPosition.RIGHT) {
        gridData.horizontalSpan = span + spanMod;
    }
    graph.setLayoutConstraint(this, nodeFigure, gridData);
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph) GridData(org.eclipse.draw2d.GridData) LockGraphNode(org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode)

Example 3 with LockGraphNode

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode in project dbeaver by serge-rider.

the class LockGraphNodeEditPart method refreshVisuals.

@Override
protected void refreshVisuals() {
    LockGraphNode node = (LockGraphNode) getModel();
    LockGraph lgraph = (LockGraph) ((LockGraphEditPart) getParent()).getModel();
    LockGraphNodeFigure nodeFigure = (LockGraphNodeFigure) getFigure();
    LockGraphEditPart graph = (LockGraphEditPart) getParent();
    GridData gridData = new GridData(55, 30);
    gridData.horizontalAlignment = GridData.CENTER;
    gridData.verticalAlignment = GridData.CENTER;
    gridData.verticalSpan = 10;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    int span = lgraph.getMaxWidth() / node.getSpan();
    int spanMod = lgraph.getMaxWidth() % node.getSpan();
    gridData.horizontalSpan = 0;
    if (span > 1 && node.getLevelPosition() != LockGraphNode.LevelPosition.RIGHT) {
        gridData.horizontalSpan = span;
    } else if (spanMod > 0 && node.getLevelPosition() == LockGraphNode.LevelPosition.RIGHT) {
        gridData.horizontalSpan = span + spanMod;
    }
    graph.setLayoutConstraint(this, nodeFigure, gridData);
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph) GridData(org.eclipse.draw2d.GridData) LockGraphNode(org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode)

Example 4 with LockGraphNode

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode in project dbeaver by dbeaver.

the class LockGraphNodeEditPart method createFigure.

@Override
protected IFigure createFigure() {
    LockGraphNode node = (LockGraphNode) getModel();
    LockGraph graph = (LockGraph) getParent().getModel();
    LockGraphNodeFigure nodeFigure = new LockGraphNodeFigure(node.getTitle(), (node == graph.getSelection()));
    this.targetAnchor = new LockGraphConnectionAnchor(nodeFigure);
    this.sourceAnchor = new LockGraphConnectionAnchor(nodeFigure);
    return nodeFigure;
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph) LockGraphNode(org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode)

Aggregations

LockGraph (org.jkiss.dbeaver.model.impl.admin.locks.LockGraph)4 LockGraphNode (org.jkiss.dbeaver.model.impl.admin.locks.LockGraphNode)4 GridData (org.eclipse.draw2d.GridData)2