1 19 package org.openharmonise.him.metadata.range.swing.domain; 20 21 import java.awt.Color ; 22 import java.awt.Component ; 23 import java.awt.Container ; 24 import java.awt.Dimension ; 25 import java.awt.Font ; 26 import java.awt.LayoutManager ; 27 28 import javax.swing.BorderFactory ; 29 import javax.swing.JLabel ; 30 import javax.swing.JPanel ; 31 32 37 public class DomainSelectionHeader extends JPanel implements LayoutManager { 38 39 private JLabel m_resourceLabel = null; 40 41 private JLabel m_typeLabel = null; 42 43 private JLabel m_minLabel = null; 44 45 private JLabel m_maxLabel = null; 46 47 50 public DomainSelectionHeader() { 51 super(); 52 this.setup(); 53 } 54 55 private void setup() { 56 this.setLayout(this); 57 58 String fontName = "Dialog"; 59 int fontSize = 11; 60 Font boldFont = new Font (fontName, Font.BOLD, fontSize); 61 62 this.m_resourceLabel = new JLabel (" Collection"); 63 this.m_resourceLabel.setBackground(Color.WHITE); 64 this.m_resourceLabel.setBorder( BorderFactory.createLineBorder(Color.BLACK) ); 65 this.m_resourceLabel.setFont(boldFont); 66 this.add(m_resourceLabel); 67 68 this.m_typeLabel = new JLabel (" Type"); 69 this.m_typeLabel.setBackground(Color.WHITE); 70 this.m_typeLabel.setBorder( BorderFactory.createLineBorder(Color.BLACK) ); 71 this.m_typeLabel.setFont(boldFont); 72 this.add(m_typeLabel); 73 74 this.m_minLabel = new JLabel (" Min"); 75 this.m_minLabel.setBackground(Color.WHITE); 76 this.m_minLabel.setBorder( BorderFactory.createLineBorder(Color.BLACK) ); 77 this.m_minLabel.setFont(boldFont); 78 this.add(m_minLabel); 79 80 this.m_maxLabel = new JLabel (" Max"); 81 this.m_maxLabel.setBackground(Color.WHITE); 82 this.m_maxLabel.setBorder( BorderFactory.createLineBorder(Color.BLACK) ); 83 this.m_maxLabel.setFont(boldFont); 84 this.add(m_maxLabel); 85 86 } 87 88 91 public Dimension getPreferredSize() { 92 return new Dimension (300, 20); 93 } 94 95 98 public void layoutContainer(Container arg0) { 99 this.m_resourceLabel.setSize(100, 20); 100 this.m_resourceLabel.setLocation(0, 0); 101 102 this.m_typeLabel.setSize(100, 20); 103 this.m_typeLabel.setLocation(100, 0); 104 105 this.m_minLabel.setSize(50, 20); 106 this.m_minLabel.setLocation(200, 0); 107 108 this.m_maxLabel.setSize(50, 20); 109 this.m_maxLabel.setLocation(250, 0); 110 } 111 112 115 public void removeLayoutComponent(Component arg0) { 116 } 117 118 121 public void addLayoutComponent(String arg0, Component arg1) { 122 } 123 124 127 public Dimension minimumLayoutSize(Container arg0) { 128 return this.getPreferredSize(); 129 } 130 131 134 public Dimension preferredLayoutSize(Container arg0) { 135 return this.getPreferredSize(); 136 } 137 138 141 public DomainSelectionHeader(boolean arg0) { 142 super(arg0); 143 } 144 145 148 public DomainSelectionHeader(LayoutManager arg0) { 149 super(arg0); 150 } 151 152 156 public DomainSelectionHeader(LayoutManager arg0, boolean arg1) { 157 super(arg0, arg1); 158 } 159 160 } 161 | Popular Tags |