Package com.vlsolutions.swing.docking

Examples of com.vlsolutions.swing.docking.DockViewTitleBar


   * to the control highlight color.
   */
  public void paint(Graphics g, JComponent c){

     
    DockViewTitleBar tb = (DockViewTitleBar)c;
    if (useCustomPaint) {
      Graphics2D g2 = (Graphics2D) g.create();
      g2.setColor(panelColor);
      g2.fillRect(0, 0, tb.getWidth(), tb.getHeight()); // emptyborder doesnt repaint
     
      Insets i = tb.getInsets();
      g2.setColor(tb.getBackground());
      Rectangle r = tb.getTitleLabel().getBounds();
      int w = r.x + r.width;
      g2.fillRect(i.left, i.top, w,
          tb.getHeight() - i.top - i.bottom);
      // gradient paint after the label text (to ensure readeability)
      if (tb.isActive()) {
        g2.setPaint(new GradientPaint(i.left + w, 0, tb.getBackground(),
            tb.getWidth(), 0,
            highlight));
      } else {
        g2.setPaint(new GradientPaint(i.left + w, 0, tb.getBackground(),
            tb.getWidth(), 0,
            highlight)); //panelColor));
      }
      g2.fillRect(i.left + w, i.top,
          tb.getWidth() - w - i.left - i.right,
          tb.getHeight() - i.top - i.bottom);
     
      g2.dispose();
    }
    super.paint(g, c);
   
View Full Code Here

TOP

Related Classes of com.vlsolutions.swing.docking.DockViewTitleBar

Copyright © 2018 www.massapicom. 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.