Examples of CellRendererPane


Examples of javax.swing.CellRendererPane

        return new BasicTableHeaderUI();
    }

    public void installUI(final JComponent c) {
        header = (JTableHeader)c;
        rendererPane = new CellRendererPane();

        installDefaults();
        installListeners();
        installKeyboardActions();
    }
View Full Code Here

Examples of javax.swing.CellRendererPane

    public void testPaint() throws Exception {
        ui.table = new JTable();
        DefaultTableModel model = (DefaultTableModel) ui.table.getModel();
        model.addColumn("column1");
        model.addRow(new Object[] { "1" });
        ui.rendererPane = new CellRendererPane();
        Graphics g = createTestGraphics();
        g.setClip(0, 0, 100, 100);
        ui.paint(g, null);
    }
View Full Code Here

Examples of javax.swing.CellRendererPane

        assertNull(button.listBox);
        assertNull(button.rendererPane);
        assertFalse(button.isIconOnly());
        JComboBox comboBox = new JComboBox();
        Icon comboIcon = new ImageIcon();
        CellRendererPane rendererPane = new CellRendererPane();
        JList list = new JList();
        button = new MetalComboBoxButton(comboBox, comboIcon, rendererPane, list);
        assertEquals(comboBox, button.comboBox);
        assertEquals(comboIcon, button.comboIcon);
        assertEquals(rendererPane, button.rendererPane);
View Full Code Here

Examples of javax.swing.CellRendererPane

  /**
   * Returns the renderer pane that renderer components are placed in.
   */
  protected CellRendererPane createCellRendererPane() {
    return new CellRendererPane();
  }
View Full Code Here

Examples of javax.swing.CellRendererPane

  private MouseListener rolloverListener;

  public SkinComboBoxUI() {
    // Install a new renderer for the selected value which will work with
    // both Java 1.4 and 1.5.
    currentValuePane = new CellRendererPane() {
      public void paintComponent(
          Graphics g,
          Component c,
          Container p,
          int x,
View Full Code Here

Examples of javax.swing.CellRendererPane

    config=GraphicConfiguration.getInstance();
    linkRenderer = new LinkRenderer();
    renderer=new NetworkCellRenderer(graphInfo);
    if (container!=null){
      editor=new NetworkCellEditor(graphInfo,container);
      rendererPane=new CellRendererPane();
      container.add(rendererPane);
    }
  }
View Full Code Here

Examples of javax.swing.CellRendererPane

    this.g = g;

    // Initializes the cell renderer pane for drawing HTML markup
    try
    {
      rendererPane = new CellRendererPane();
    }
    catch (Exception e)
    {
      // ignore
    }
View Full Code Here

Examples of javax.swing.CellRendererPane

    state.g = g;

    // Initializes the cell renderer pane for drawing HTML markup
    try
    {
      rendererPane = new CellRendererPane();
    }
    catch (Exception e)
    {
      // ignore
    }
View Full Code Here

Examples of javax.swing.CellRendererPane

  public void paintShape(mxGraphics2DCanvas canvas, String text,
      mxCellState state, Map<String, Object> style)
  {
    mxLightweightLabel textRenderer = mxLightweightLabel
        .getSharedInstance();
    CellRendererPane rendererPane = canvas.getRendererPane();
    Rectangle rect = state.getLabelBounds().getRectangle();
    Graphics2D g = canvas.getGraphics();

    if (textRenderer != null
        && rendererPane != null
        && (g.getClipBounds() == null || g.getClipBounds().intersects(
            rect)))
    {
      double scale = canvas.getScale();
      int x = rect.x;
      int y = rect.y;
      int w = rect.width;
      int h = rect.height;

      if (!mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true))
      {
        g.rotate(-Math.PI / 2, x + w / 2, y + h / 2);
        g.translate(w / 2 - h / 2, h / 2 - w / 2);

        int tmp = w;
        w = h;
        h = tmp;
      }

      // Replaces the linefeeds with BR tags
      if (isReplaceHtmlLinefeeds())
      {
        text = text.replaceAll("\n", "<br>");
      }

      // Renders the scaled text
      textRenderer.setText(createHtmlDocument(style, text,
          (int) Math.round(w / state.getView().getScale()),
          (int) Math.round(h / state.getView().getScale())));
      textRenderer.setFont(mxUtils.getFont(style, canvas.getScale()));
      g.scale(scale, scale);
      rendererPane.paintComponent(g, textRenderer, rendererPane,
          (int) (x / scale) + mxConstants.LABEL_INSET,
          (int) (y / scale) + mxConstants.LABEL_INSET,
          (int) (w / scale), (int) (h / scale), true);
    }
  }
View Full Code Here

Examples of javax.swing.CellRendererPane

    int w = icon.getIconWidth();
    int h = icon.getIconHeight();
    BufferedImage image =
        BasicUtilities.createCompatibleImage(w, h, Transparency.TRANSLUCENT);
    Graphics2D g = image.createGraphics();
    icon.paintIcon(new CellRendererPane(), g, 0, 0);
    g.dispose();
    return image;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.