Tabnine Logo
RectangleFigure
Code IndexAdd Tabnine to your IDE (free)

How to use
RectangleFigure
in
org.jhotdraw.draw

Best Java code snippets using org.jhotdraw.draw.RectangleFigure (Showing top 18 results out of 315)

origin: stackoverflow.com

 ...

RectangleFigure rect=new RectangleFigure();
rect.setBounds(new Rectangle(10, 10, 5, 25));
rect.setBorder(new SimpleRaisedBorder());
rect.setLayoutManager(new StackLayout());

RectangleFigure rect2=new RectangleFigure();
rect2.setBounds(new Rectangle(10, 10, 5, 25));
rect2.setBorder(new SimpleRaisedBorder());
rect2.setLayoutManager(new StackLayout());

...

fp.add(content);
rect2.add(fp);
rect.add(rect2);
panel.add(rect);
origin: net.imagej/imagej-ui-swing

@Override
public Shape toShape(final RectangleFigure figure) {
  return figure.getBounds();
}
origin: stackoverflow.com

private RectangleFigure fetchNode(String node_label) {
   RectangleFigure emptyNode = new RectangleFigure();
   // get the list of nodes drawn on canvas
   @SuppressWarnings("rawtypes")
   List childrens = panel.getChildren();  //private IFigure panel;
   for (int count = 0; count < childrens.size(); count++) {
     if (childrens.get(count) instanceof RectangleFigure) {
       RectangleFigure node = (RectangleFigure) childrens.get(count);
       @SuppressWarnings("rawtypes")
       List node_children = node.getChildren();
       for (int count2 = 0; count2 < node_children.size(); count2++) {
         if (node_children.get(count2) instanceof Label) {
           Label lbl = (Label) node_children.get(count2);
           if (lbl.getText().equals(node_label)) {
             return node;
           }
         }
       }
     }
   }
   return emptyNode;
 }
origin: stackoverflow.com

 // from your code
rectangle.setBackgroundColor(ColorConstants.green);

// new code
RectangleFigure r2 = new RectangleFigure();
r2.setBounds(new Rectangle(0,0,10,10));
r2.setBackgroundColor(ColorConstants.blue);
rectangle.add(r2);

// back to your code
lws.setContents(rectangle);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Moves the Figure to a new location.
 * @param tx the transformation matrix.
 */
@Override
public void transform(AffineTransform tx) {
  Point2D.Double anchor = getStartPoint();
  Point2D.Double lead = getEndPoint();
  setBounds(
      (Point2D.Double) tx.transform(anchor, anchor),
      (Point2D.Double) tx.transform(lead, lead)
      );
}

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
public void run() {
  RectangleFigure ta = new RectangleFigure();
  ta.setBounds(new Point2D.Double(10, 10), new Point2D.Double(100, 100));
  RectangleFigure tb = new RectangleFigure();
  tb.setBounds(new Point2D.Double(210, 110), new Point2D.Double(300, 200));
  cf.setStartConnector(ta.findConnector(Geom.center(ta.getBounds()), cf));
  cf.setEndConnector(tb.findConnector(Geom.center(tb.getBounds()), cf));
origin: stackoverflow.com

RectangleFigure node1 = new RectangleFigure();
Rectangle rect = new Rectangle(droppoint.x, droppoint.y, 20, 20);
Rectangle rect2 = new Rectangle(droppoint.x, droppoint.y, 100, 25);
node1.setBounds(rect);
node1.setBackgroundColor(ColorConstants.cyan);
node1.add(droppedName);
panel.add(node1);
panel.add(droppedName);
origin: net.imagej/imagej-ui-swing

@Override
public Figure createDefaultFigure() {
  final RectangleFigure figure = new RectangleFigure();
  initDefaultSettings(figure);
  return figure;
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

super(new RectangleFigure());
RectangleFigure nameCompartmentPF = new RectangleFigure();
nameCompartmentPF.set(STROKE_COLOR, null);
nameCompartmentPF.setAttributeEnabled(STROKE_COLOR, false);
nameCompartmentPF.set(FILL_COLOR, null);
nameCompartmentPF.setAttributeEnabled(FILL_COLOR, false);
ListFigure nameCompartment = new ListFigure(nameCompartmentPF);
ListFigure attributeCompartment = new ListFigure();
origin: net.imagej/imagej-ui-swing

@Override
public void
  updateFigure(final OverlayView view, final RectangleFigure figure)
{
  super.updateFigure(view, figure);
  final RectangleOverlay overlay = downcastOverlay(view.getData());
  final double x0 = overlay.getOrigin(0);
  final double y0 = overlay.getOrigin(1);
  final double w = overlay.getExtent(0);
  final double h = overlay.getExtent(1);
  final Point2D.Double anch = new Point2D.Double(x0, y0);
  final Point2D.Double lead = new Point2D.Double(x0 + w, y0 + h);
  figure.setBounds(anch, lead);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

ButtonFactory.addToolTo(
    tb, editor,
    new CreationTool(new RectangleFigure()),
    "edit.createRectangle",
    labels);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

ButtonFactory.addToolTo(
    tb, editor,
    new CreationTool(new RectangleFigure(), a),
    "edit.createRectangle",
    labels);
origin: net.imagej/imagej-ui-swing

@Override
public void updateOverlay(final RectangleFigure figure,
  final OverlayView view)
{
  super.updateOverlay(figure, view);
  final RectangleOverlay overlay = downcastOverlay(view.getData());
  final Rectangle2D.Double bounds = figure.getBounds();
  final double x = bounds.getMinX();
  final double y = bounds.getMinY();
  final double w = bounds.getWidth();
  final double h = bounds.getHeight();
  overlay.setOrigin(x, 0);
  overlay.setOrigin(y, 1);
  overlay.setExtent(w, 0);
  overlay.setExtent(h, 1);
  overlay.update();
  toolService.reportRectangle(x, y, w, h);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

new CreationTool(new RectangleFigure()),
"edit.createRectangle",
labels);
origin: stackoverflow.com

RectangleFigure rectangleFigure = new RectangleFigure();
rectangleFigure.setBackgroundColor(ColorConstants.yellow);
rectangleFigure.setSize(100, 100);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/** Creates a new instance. */
public NodeFigure() {
  RectangleFigure rf = new RectangleFigure();
  setDecorator(rf);
  createConnectors();
  set(DECORATOR_INSETS, new Insets2D.Double(6, 10, 6, 10));
  ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.samples.net.Labels");
  setText(labels.getString("nodeDefaultName"));
  setAttributeEnabled(DECORATOR_INSETS, false);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

ConnectionFigure lc;
ButtonFactory.addToolTo(tb, editor, new CreationTool(new RectangleFigure()), "edit.createRectangle", labels);
ButtonFactory.addToolTo(tb, editor, new CreationTool(new RoundRectangleFigure()), "edit.createRoundRectangle", labels);
ButtonFactory.addToolTo(tb, editor, new CreationTool(new EllipseFigure()), "edit.createEllipse", labels);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

ConnectionFigure lc;
ButtonFactory.addToolTo(tb, editor, new CreationTool(new RectangleFigure()), "edit.createRectangle", labels);
ButtonFactory.addToolTo(tb, editor, new CreationTool(new RoundRectangleFigure()), "edit.createRoundRectangle", labels);
ButtonFactory.addToolTo(tb, editor, new CreationTool(new EllipseFigure()), "edit.createEllipse", labels);
org.jhotdraw.drawRectangleFigure

Javadoc

A Figure with a rectangular shape.

Most used methods

  • <init>
  • setBounds
  • getBounds
  • add
  • findConnector
  • getChildren
  • getEndPoint
  • getStartPoint
  • set
  • setAttributeEnabled
  • setBackgroundColor
  • setBorder
  • setBackgroundColor,
  • setBorder,
  • setLayoutManager

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now