protected RectangleFigure createFeedbackFigure() { RectangleFigure feedbackFigure = new RectangleFigure(); feedbackFigure.setFill(true); feedbackFigure.setOutline(true); feedbackFigure.setLineWidth(1); feedbackFigure.setForegroundColor(ColorConstants.red); feedbackFigure.setBounds(new Rectangle(0, 0, 0, 0)); feedbackFigure.setXOR(true); addFeedback(feedbackFigure); return feedbackFigure; }
public Dimension getPreferredSize(int wHint, int hHint) { Dimension d = super.getPreferredSize(wHint, hHint); d.width += 20; d.height = 1; return d; } };
protected void showFeedbackRect(Rectangle rect) { RectangleFigure pf = getFeedbackFigure(); pf.translateToRelative(rect); pf.setBounds(rect); }
protected void addMouseOverBorder() { if (_mouseOverBorder == null) { _mouseOverBorder = new RectangleFigure(); _mouseOverBorder.setFill(false); _mouseOverBorder.setOutline(true); _mouseOverBorder.setLineWidth(1); _mouseOverBorder.setForegroundColor(HOVER_FEEDBACK_COLOR); } addFeedback(_mouseOverBorder); IFigure hostFigure = getHostFigure(); Rectangle r = hostFigure.getBounds().getCopy().expand(1, 1); hostFigure.translateToAbsolute(r); _mouseOverBorder.translateToRelative(r); _mouseOverBorder.setBounds(r); }
RectangleFigure rectangleShape = new RectangleFigure(); rectangleShape.setBackgroundColor(colour); rectangleShape.setForegroundColor(colour); rectangleShape.setAlpha(50); rectangleShape.setOpaque(true); int topInset = 0; int leftInset = 0; case WEST: case EAST: rectangleShape.setSize(SIZE + 1, 1); topInset = (SIZE / 2) + ALIGNMENT; break; case NORTH: case SOUTH: rectangleShape.setSize(1, SIZE + 1); leftInset = (SIZE / 2) + ALIGNMENT; break;
RectangleFigure container = new RectangleFigure(); NoSpacingGridLayout containerLayout = new NoSpacingGridLayout(1); container.setLayoutManager(containerLayout); container.setBackgroundColor(backgroundColour); container.setOpaque(true); this.add(container); (includeIsPublicFigure ? 2 : 1), false); header.setLayoutManager(headerLayout); container.add(header); 2)); contentPaneWrap.add(this.contentPane); container.add(contentPaneWrap); containerLayout.setConstraint(contentPaneWrap, new GridData(SWT.FILL, 0, true, false));
protected IFigure createFigure() { outer = new Figure(); outer.setBorder(new LineBorder(1)); FillLayout fillLayout = new FillLayout(4); outer.setLayoutManager(fillLayout); headingFigure = new HeadingFigure(); outer.add(headingFigure); RectangleFigure line = new RectangleFigure() { public Dimension getPreferredSize(int wHint, int hHint) { Dimension d = super.getPreferredSize(wHint, hHint); d.height = 1; return d; } }; ToolbarLayout lineLayout = new ToolbarLayout(false); lineLayout.setVertical(true); lineLayout.setStretchMinorAxis(true); line.setLayoutManager(lineLayout); outer.add(line); contentFigure = new Figure(); contentFigure.setBorder(new MarginBorder(4)); fillLayout = new FillLayout(4); contentFigure.setLayoutManager(fillLayout); outer.add(contentFigure); return outer; }
public Rectangle getBounds() { Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation(); bounds.translate(p); return super.getBounds().getCopy().translate(p); } }
RectangleFigure fig = new RectangleFigure(); fig.setFill(false); fig.setOutline(true); fig.setLineWidth(1); fig.setForegroundColor(HOVER_FEEDBACK_COLOR); addFeedback(fig); fig.translateToRelative(r); fig.setBounds(r);
RectangleFigure container = new RectangleFigure(); container.setLayoutManager(new NoSpacingGridLayout(1)); container.setBackgroundColor(StandardOfficeFloorColours .INPUT_MANAGED_OBJECT()); this.name = new Label(context.getOfficeFloorInputManagedObjectName()); this.name.setBorder(new MarginBorder(3, 3, 3, 3)); container.add(this.name); objectContainerMos.add(container);
protected final RectangleFigure showFeedbackRect(Rectangle rect) { RectangleFigure pf = createFeedbackFigure(); pf.translateToRelative(rect); pf.setBounds(rect); return pf; }
lineLayout.setVertical(true); lineLayout.setStretchMinorAxis(true); line.setLayoutManager(lineLayout); outerPane.add(line);
protected RectangleFigure getFeedbackFigure() { if (_feedbackFigure == null) { _feedbackFigure = new RectangleFigure(); _feedbackFigure.setFill(true); _feedbackFigure.setOutline(true); _feedbackFigure.setLineWidth(1); _feedbackFigure.setForegroundColor(ColorConstants.red); _feedbackFigure.setBounds(new Rectangle(0, 0, 0, 0)); _feedbackFigure.setXOR(true); addFeedback(_feedbackFigure); } return _feedbackFigure; }
public Dimension getPreferredSize(int wHint, int hHint) { Dimension d = super.getPreferredSize(wHint, hHint); d.height = 1; return d; } };