1 19 24 25 package org.netbeans.swing.tabcontrol; 26 27 import org.netbeans.swing.tabcontrol.event.TabActionEvent; 28 29 import javax.swing.*; 30 import javax.swing.plaf.ComponentUI ; 31 import java.awt.*; 32 import java.awt.event.HierarchyEvent ; 33 import java.awt.event.MouseEvent ; 34 35 48 public abstract class TabbedContainerUI extends ComponentUI { 49 52 protected TabbedContainer container = null; 53 54 57 public TabbedContainerUI(TabbedContainer container) { 58 this.container = container; 59 } 60 61 public void installUI(JComponent c) { 62 assert c == container; 63 } 64 65 82 protected boolean uichange() { 83 return false; 84 } 85 86 90 final boolean shouldReplaceUI() { 91 return uichange(); 92 } 93 94 95 103 public abstract Rectangle getTabRect(int tab, Rectangle r); 104 105 111 public abstract int tabForCoordinate (Point p); 112 113 118 public abstract void makeTabVisible (int index); 119 120 137 protected final boolean shouldPerformAction(String command, int tab, 138 MouseEvent event) { 139 TabActionEvent evt = new TabActionEvent(container, command, tab, event); 140 container.postActionEvent(evt); 141 return !evt.isConsumed(); 142 } 143 144 150 public abstract SingleSelectionModel getSelectionModel(); 151 152 153 public abstract Image createImageOfTab(int idx); 154 155 156 public abstract Polygon getExactTabIndication (int idx); 157 158 166 public abstract Polygon getInsertTabIndication (int idx); 167 168 169 public abstract Rectangle getContentArea (); 170 171 172 public abstract Rectangle getTabsArea (); 173 174 182 public abstract int dropIndexOfPoint(Point p); 183 184 public abstract void setShowCloseButton (boolean val); 185 186 public abstract boolean isShowCloseButton (); 187 188 protected abstract void requestAttention (int tab); 189 190 protected abstract void cancelRequestAttention (int tab); 191 192 } 193 | Popular Tags |