Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Dimension


    ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure, constraint);

    // Check for first Layout refresh and set model to preferred size
    INode model = (INode) getModel();
    if (model.getHeightInLayout() == -1 || model.getWidthInLayout() == -1) {
      Dimension size = getFigure().getPreferredSize();
      // TODO remove hack
      model.setSizeInLayout(size.width * 1.618, size.height * 1.618); // Factor Phi
//      model.setSizeInLayout(size.width, size.height);
    }
  }
View Full Code Here


    HashMap mapping = new HashMap(entitiesToLayout.length);
    DirectedGraph graph = new DirectedGraph();
    for (int i = 0; i < entitiesToLayout.length; i++) {
      InternalNode internalNode = entitiesToLayout[i];
      Node node = new Node(internalNode);
      node.setSize(new Dimension(10, 10));
      mapping.put(internalNode, node);
      graph.nodes.add(node);
    }
    for (int i = 0; i < relationshipsToConsider.length; i++) {
      InternalRelationship relationship = relationshipsToConsider[i];
View Full Code Here

    }
   
    protected void refreshVisuals() {
        Box scalebarBox = (Box) this.getModel();
        Point loc = scalebarBox.getLocation();
        Dimension size = scalebarBox.getSize();
        Rectangle rectangle = new Rectangle(loc, size);
       
        ((BoxFigure) getFigure()).setBox((Box) getModel());
       
        ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), rectangle);
View Full Code Here

        text.setText(((LabelBoxPrinter) ((Box)getEditPart().getModel()).getBoxPrinter()).getText());
        getCellEditor().setValue(this.nodeFigure.getText());
        IFigure figure = ((GraphicalEditPart) getEditPart()).getFigure();
        scaledFont = figure.getFont();
        FontData data = scaledFont.getFontData()[0];
        Dimension fontSize = new Dimension(0, data.getHeight());
        data.setHeight(fontSize.height);
        scaledFont = new Font(null, data);
       
        text.setFont(scaledFont);
        text.selectAll();
View Full Code Here

    return newBox != null && parent != null && bounds != null;
  }
 
  public void execute() {
    newBox.setLocation(bounds.getLocation());
    Dimension size = bounds.getSize();
    if (size.width > 0 && size.height > 0)
      newBox.setSize(size);
    redo();
  }
View Full Code Here

  }

  protected void refreshVisuals() {
        Box labelBox = (Box) this.getModel();
        Point loc = labelBox.getLocation();
        Dimension size = labelBox.getSize();
        Rectangle rectangle = new Rectangle(loc, size);

        ((BoxFigure) this.getFigure()).setBox((Box) this.getModel());

        ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), rectangle);
View Full Code Here

    protected void refreshVisuals() {
        Page page = getModel();

        Point loc = new Point(0, 0);
        Dimension size = page.getSize();
        Rectangle rectangle = new Rectangle(loc, size);

        // this should trigger all the resize in PageImpl
        IFigure fig = getFigure();
        // Dimension fSize = fig.getSize();
View Full Code Here

public class ImageTemplate extends AbstractTemplate {

    public void init( Page page, Map map ) {       
        page.setName(map.getName());

        Dimension a4 = new Dimension( 842, 595 ); // assume 72 pixels per inch
        page.setSize( a4 );       

        Box labelBox = ModelFactory.eINSTANCE.createBox();
        Box mapBox = ModelFactory.eINSTANCE.createBox();
        Box imageBox = ModelFactory.eINSTANCE.createBox();
       
        boxes.add(labelBox);
        boxes.add(mapBox);
        boxes.add(imageBox);
       
        mapBox.setSize(new Dimension(400, 400));
        imageBox.setSize(new Dimension(200, 162));
        labelBox.setSize(new Dimension(150, 30));
       
        imageBox.setLocation(new Point(43, 10));
        mapBox.setLocation(new Point(143, 210));
        labelBox.setLocation(new Point(100, 612));
       
View Full Code Here

    public void draw( Graphics2D graphics, IProgressMonitor monitor ) {
        super.draw(graphics, monitor);
       
        try {
            Dimension size = this.getBox().getSize();
           
            //reduce set a 1 pixel clip bound around outside to prevent
            //some Graphics2D implementations (itext!) from bleeding into space
            //outside the graphics canvas
            graphics.setClip(1, 1, size.width-2, size.height-2);
View Full Code Here

    }

    BufferedImage preview;
    State current;
    public void createPreview( Graphics2D graphics, final IProgressMonitor monitor ) {
    Dimension size = getBox().getSize();

        try {
            if (map != null) {
                preview = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = preview.createGraphics();
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.geometry.Dimension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.