RectanglePainter.getBorderPaint
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.jdesktop.swingx.painter.RectanglePainter.getBorderPaint(Showing top 4 results out of 315)

origin: org.swinglabs/swingx

private void drawBorder(Graphics2D g, Shape shape, int width, int height) {
  Paint p = getBorderPaint();
  if(isPaintStretched()) {
    p = calculateSnappedPaint(p, width, height);
  }
  g.setPaint(p);
  g.setStroke(new BasicStroke(getBorderWidth()));
  
  // shrink the border by 1 px
  if(shape instanceof Rectangle2D) {
    Rectangle2D rect = (Rectangle2D) shape;
    
    g.draw(new Rectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1));
  } else if(shape instanceof RoundRectangle2D) {
    RoundRectangle2D rect = (RoundRectangle2D) shape;
    
    g.draw(new RoundRectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1,
        rect.getArcWidth(), rect.getArcHeight()));
  } else {
    g.draw(shape);
  }
}
origin: org.swinglabs.swingx/swingx-painters

private void drawBorder(Graphics2D g, Shape shape, int width, int height) {
  Paint p = getBorderPaint();
  if(isPaintStretched()) {
    p = calculateSnappedPaint(p, width, height);
  }
  g.setPaint(p);
  g.setStroke(new BasicStroke(getBorderWidth()));
  
  // shrink the border by 1 px
  if(shape instanceof Rectangle2D) {
    Rectangle2D rect = (Rectangle2D) shape;
    
    g.draw(new Rectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1));
  } else if(shape instanceof RoundRectangle2D) {
    RoundRectangle2D rect = (RoundRectangle2D) shape;
    
    g.draw(new RoundRectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1,
        rect.getArcWidth(), rect.getArcHeight()));
  } else {
    g.draw(shape);
  }
}
origin: org.swinglabs/swingx-core

private void drawBorder(Graphics2D g, Shape shape, int width, int height) {
  Paint p = getBorderPaint();
  if(isPaintStretched()) {
    p = calculateSnappedPaint(p, width, height);
  }
  g.setPaint(p);
  g.setStroke(new BasicStroke(getBorderWidth()));
  
  // shrink the border by 1 px
  if(shape instanceof Rectangle2D) {
    Rectangle2D rect = (Rectangle2D) shape;
    
    g.draw(new Rectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1));
  } else if(shape instanceof RoundRectangle2D) {
    RoundRectangle2D rect = (RoundRectangle2D) shape;
    
    g.draw(new RoundRectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1,
        rect.getArcWidth(), rect.getArcHeight()));
  } else {
    g.draw(shape);
  }
}
origin: org.swinglabs.swingx/swingx-all

private void drawBorder(Graphics2D g, Shape shape, int width, int height) {
  Paint p = getBorderPaint();
  if(isPaintStretched()) {
    p = calculateSnappedPaint(p, width, height);
  }
  g.setPaint(p);
  g.setStroke(new BasicStroke(getBorderWidth()));
  
  // shrink the border by 1 px
  if(shape instanceof Rectangle2D) {
    Rectangle2D rect = (Rectangle2D) shape;
    
    g.draw(new Rectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1));
  } else if(shape instanceof RoundRectangle2D) {
    RoundRectangle2D rect = (RoundRectangle2D) shape;
    
    g.draw(new RoundRectangle2D.Double(rect.getX(), rect.getY(),
        rect.getWidth()-1, rect.getHeight()-1,
        rect.getArcWidth(), rect.getArcHeight()));
  } else {
    g.draw(shape);
  }
}
org.jdesktop.swingx.painterRectanglePaintergetBorderPaint

Popular methods of RectanglePainter

  • calculateLayout
  • calculateShape
  • calculateSnappedPaint
  • drawBackground
  • drawBorder
  • firePropertyChange
  • getAreaEffects
  • getBorderWidth
  • getFillPaint
  • getInsets
  • getRoundHeight
    gets the round height of the rectangle
  • getRoundWidth
    gets the round width of the rectangle
  • getRoundHeight,
  • getRoundWidth,
  • getStyle,
  • isFillHorizontal,
  • isFillVertical,
  • isPaintStretched,
  • isRounded,
  • provideShape,
  • setBorderPaint

Popular classes and methods

  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashSet (java.util)
    This class implements the Set interface, backed by a java.util.HashMap.

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)