Search in sources :

Example 1 with LockGraph

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraph 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 LockGraph

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

the class LockGraphicalView method drawGraf.

public void drawGraf(DBAServerLock selection) {
    if (selection == null)
        return;
    LockGraph g = selection == null ? EMPTY_GRAPH : graphManager.getGraph(selection);
    if (g == null)
        return;
    /*
		if (g != EMPTY_GRAPH) {
			g.setLockManagerViewer(viewer);
		}
*/
    getGraphicalViewer().setContents(g);
    getGraphicalViewer().getControl().setBackground(ColorConstants.listBackground);
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph)

Example 3 with LockGraph

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraph 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 4 with LockGraph

use of org.jkiss.dbeaver.model.impl.admin.locks.LockGraph 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 5 with LockGraph

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

the class LockGraphicalView method drawGraf.

public void drawGraf(DBAServerLock selection) {
    if (selection == null)
        return;
    LockGraph g = selection == null ? EMPTY_GRAPH : graphManager.getGraph(selection);
    if (g == null)
        return;
    /*
		if (g != EMPTY_GRAPH) {
			g.setLockManagerViewer(viewer);
		}
*/
    getGraphicalViewer().setContents(g);
    getGraphicalViewer().getControl().setBackground(ColorConstants.listBackground);
}
Also used : LockGraph(org.jkiss.dbeaver.model.impl.admin.locks.LockGraph)

Aggregations

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