Search in sources :

Example 96 with Rectangle

use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.

the class BrokerDBListFigure method fillShape.

/**
	 * fill shapge
	 * 
	 * @param graphics Graphics
	 */
protected void fillShape(Graphics graphics) {
    super.fillShape(graphics);
    Rectangle r = getBounds();
    graphics.drawLine(r.x, r.y + TITLE_HEIGHT, r.x + r.width, r.y + TITLE_HEIGHT);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle)

Example 97 with Rectangle

use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.

the class ClientFigure method fillShape.

/**
	 * fill shapge
	 * 
	 * @param graphics Graphics
	 */
protected void fillShape(Graphics graphics) {
    super.fillShape(graphics);
    Rectangle r = getBounds();
    graphics.drawLine(r.x, r.y + TITLE_HEIGHT, r.x + r.width, r.y + TITLE_HEIGHT);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle)

Example 98 with Rectangle

use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.

the class DatabaseNodeAnchor method getLocation.

/**
	 * Return the point to connect.
	 * 
	 * @param reference source point location
	 * @return target point.
	 */
public Point getLocation(Point reference) {
    Point result = super.getLocation(reference);
    Rectangle rect = this.getOwner().getBounds();
    if ((result.x - reference.x > rect.width / 2) && (Math.abs(rect.y - reference.y) > rect.height / 2)) {
        result.y = rect.y + rect.height / 2;
        result.x = rect.x;
    } else if ((reference.x - result.x > rect.width / 2) && (Math.abs(rect.y - reference.y) > rect.height / 2)) {
        result.y = rect.y + rect.height / 2;
        result.x = rect.x + rect.width;
    }
    return result;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) Point(org.eclipse.draw2d.geometry.Point)

Example 99 with Rectangle

use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.

the class HostMonitorFigure method fillShape.

/**
	 * fill shapge
	 * 
	 * @param graphics Graphics
	 */
protected void fillShape(Graphics graphics) {
    super.fillShape(graphics);
    Rectangle r = getBounds();
    graphics.drawLine(r.x + 1, r.y + TITLE_HEIGHT, r.x + r.width - 1, r.y + TITLE_HEIGHT);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) RoundedRectangle(org.eclipse.draw2d.RoundedRectangle)

Example 100 with Rectangle

use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.

the class ContainerNodeLayoutEditPolicy method getCreateCommand.

/**
	 * @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
	 * @param request the CreateRequest
	 * @return a Command to perform a create
	 * 
	 */
protected Command getCreateCommand(CreateRequest request) {
    if (!(request.getNewObject() instanceof LeafNode)) {
        return null;
    }
    CreateLeafNodeCommand cmd = new CreateLeafNodeCommand();
    cmd.setContainerNode((ContainerNode) getHost().getModel());
    cmd.setLeafNode((LeafNode) request.getNewObject());
    Rectangle constraint = (Rectangle) getConstraintFor(request);
    cmd.setLocation(constraint.getLocation());
    return cmd;
}
Also used : LeafNode(com.cubrid.cubridmanager.ui.replication.editor.model.LeafNode) Rectangle(org.eclipse.draw2d.geometry.Rectangle) CreateLeafNodeCommand(com.cubrid.cubridmanager.ui.replication.editor.commands.CreateLeafNodeCommand)

Aggregations

Rectangle (org.eclipse.draw2d.geometry.Rectangle)197 Point (org.eclipse.draw2d.geometry.Point)59 Dimension (org.eclipse.draw2d.geometry.Dimension)43 IFigure (org.eclipse.draw2d.IFigure)31 List (java.util.List)21 DoubleRectangle (edu.cmu.cs.hcii.cogtool.model.DoubleRectangle)17 Iterator (java.util.Iterator)11 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)11 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)11 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)9 TableFigure (com.cubrid.common.ui.er.figures.TableFigure)8 ArrayList (java.util.ArrayList)8 Node (org.talend.designer.core.ui.editor.nodes.Node)8 DoublePoint (edu.cmu.cs.hcii.cogtool.model.DoublePoint)7 Figure (org.eclipse.draw2d.Figure)6 Color (org.eclipse.swt.graphics.Color)6 ERTable (com.cubrid.common.ui.er.model.ERTable)5 DesignEditorFrame (edu.cmu.cs.hcii.cogtool.uimodel.DesignEditorFrame)5 Label (org.eclipse.draw2d.Label)5 Image (org.eclipse.swt.graphics.Image)5