1 21 22 package com.sshtools.ui.swing; 23 24 import java.awt.Dimension ; 25 import javax.swing.JSeparator ; 26 import javax.swing.JToolBar ; 27 28 33 34 public class ToolBarSeparator 35 36 extends JSeparator { 37 38 41 42 public ToolBarSeparator() { 43 super(JSeparator.VERTICAL); 44 45 } 46 47 50 51 public ToolBarSeparator(int orientation) { 52 super(orientation); 53 54 } 55 56 61 62 public Dimension getMaximumSize() { 63 return (((JToolBar ) getParent()).getOrientation() == JToolBar.HORIZONTAL) ? new Dimension (4, super.getMaximumSize().height) 64 : new Dimension (super.getMaximumSize().width, 4); 65 66 } 67 68 71 72 public void doLayout() { 73 setOrientation((((JToolBar ) getParent()).getOrientation() == JToolBar.HORIZONTAL) ? JSeparator.VERTICAL 74 : JSeparator.HORIZONTAL); 75 76 } 77 78 } 79 | Popular Tags |