Examples of CellRendererPane


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

  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(mxUtils.createHtmlDocument(style, text));
      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

  /**
   * 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

        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

    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

    {
        list = (JXList)c;

        layoutOrientation = list.getLayoutOrientation();

        rendererPane = new CellRendererPane();
        list.add(rendererPane);

        columnCount = 1;

        updateLayoutStateNeeded = modelChanged;
View Full Code Here

Examples of javax.swing.CellRendererPane


    @Override
    public void installUI(final JComponent c) {
        list = (JList)c;
        rendererPane = new CellRendererPane();
        rendererPane.setVisible(false);
        list.add(rendererPane);
        layouter.setList(list);

        installDefaults();
View Full Code Here

Examples of javax.swing.CellRendererPane

        return new BasicTableHeaderUI();
    }

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

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

Examples of javax.swing.CellRendererPane

    public static ComponentUI createUI(final JComponent comboBox) {
        return new BasicComboBoxUI();
    }

    public BasicComboBoxUI() {
        currentValuePane = new CellRendererPane();
        currentValuePane.setVisible(false);
    }
View Full Code Here

Examples of javax.swing.CellRendererPane

        return rowHeight > 0 && largeModel ? (AbstractLayoutCache)new FixedHeightLayoutCache()
                                           : (AbstractLayoutCache)new VariableHeightLayoutCache();
    }

    protected CellRendererPane createCellRendererPane() {
        return new CellRendererPane();
    }
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.