Ticket #2268: 2268.patch
File 2268.patch, 12.1 KB (added by kyli, 15 years ago) |
---|
-
src/main/java/org/sophie2/main/skin/alternative/SkinDefIds.java
### Eclipse Workspace Patch 1.0 #P org.sophie2.main.skin.alternative
149 149 "main.layout.md-main-window/mydoggy-title-bar-active : icon : empty_background.png", 150 150 "main.layout.md-main-window/mydoggy-title-bar-inactive : icon : empty_background.png", 151 151 152 "main.layout.md-main-window/tab-button-thickness : integer : 39", 152 "main.layout.md-main-window/vert-tab-button-thickness : integer : 30", 153 "main.layout.md-main-window/hor-tab-button-thickness : integer : 25", 153 154 154 155 "main.layout.md-main-window/mydoggy-top-active-tab : icon : mydoggy/tabs/top_active.png", 155 156 "main.layout.md-main-window/mydoggy-bottom-active-tab : icon : mydoggy/tabs/bottom_active.png", … … 178 179 "main.layout.md-main-window/AUTO_HIDE_OFF_INACTIVE : icon : btn_flap_pin.png", 179 180 180 181 //= Palettes = 181 "main.layout.md-compound-element/tab-button-thickness : integer : 3 9",182 "main.layout.md-compound-element/tab-button-thickness : integer : 30", 182 183 "main.layout.md-compound-element/mydoggy-top-active-tab : icon : mydoggy/tabs/top_active.png", 183 184 "main.layout.md-compound-element/mydoggy-bottom-active-tab : icon : mydoggy/tabs/bottom_active.png", 184 185 "main.layout.md-compound-element/mydoggy-left-active-tab : icon : mydoggy/tabs/left_active.png", -
src/main/java/org/sophie2/main/layout/mydoggy/MDSkinUpdater.java
#P org.sophie2.main.layout.mydoggy
320 320 @Override 321 321 protected Integer compute() { 322 322 Integer res = SkinUtil.getSkinValue(skinClass().get(), 323 MDManageable.MYDOGGY_ TAB_BUTTON_THICKNESS, Integer.class);323 MDManageable.MYDOGGY_V_TAB_BUTTON_THICKNESS, Integer.class); 324 324 return res; 325 325 } 326 326 } -
src/main/java/org/sophie2/main/layout/mydoggy/MDMainWindow.java
7 7 import java.util.Collection; 8 8 import java.util.HashMap; 9 9 import java.util.Map; 10 10 11 import javax.swing.JComponent; 11 12 import javax.swing.JInternalFrame; 12 13 import javax.swing.JPanel; 13 14 import javax.swing.JScrollPane; 14 15 import javax.swing.ScrollPaneConstants; 15 16 import javax.swing.SwingUtilities; 17 16 18 import org.noos.xing.mydoggy.Content; 17 19 import org.noos.xing.mydoggy.ContentManager; 18 20 import org.noos.xing.mydoggy.DockedTypeDescriptor; … … 69 71 @SkinPartDef 70 72 private static void defineSkin(ElementSkinPart part) { 71 73 part.add(MYDOGGY_BOOLEAN_COLORED_UI, Boolean.TRUE); 72 part.add(MYDOGGY_ TAB_BUTTON_THICKNESS, 23);74 part.add(MYDOGGY_V_TAB_BUTTON_THICKNESS, 30); 73 75 part.add(MDColorId.TAB_COLOR_END.getSkinId(), DEFAULT_COLOR); 74 76 part.add(MDColorId.TAB_COLOR_START.getSkinId(), DEFAULT_COLOR); 75 77 part.add(MDColorId.TITLE_BAR_COLOR_END.getSkinId(), DEFAULT_COLOR); … … 287 289 @SuppressWarnings("synthetic-access") 288 290 @Override 289 291 protected void setup(MyDoggyToolWindowManager toolWindowManager) { 290 291 Integer thickness = getSkinValue(MYDOGGY_TAB_BUTTON_THICKNESS, Integer.class);292 if ( thickness != null) {293 toolWindowManager.getToolWindowBar(ToolWindowAnchor.LEFT).setLength( thickness);294 toolWindowManager.getToolWindowBar(ToolWindowAnchor.RIGHT).setLength( thickness);295 toolWindowManager.getToolWindowBar(ToolWindowAnchor.BOTTOM).setLength( thickness);296 toolWindowManager.getToolWindowBar(ToolWindowAnchor.TOP).setLength( thickness);292 Integer vThickness = getSkinValue(MYDOGGY_V_TAB_BUTTON_THICKNESS, Integer.class); 293 Integer hThickness = getSkinValue(MYDOGGY_H_TAB_BUTTON_THICKNESS, Integer.class); 294 if (hThickness != null && vThickness != null) { 295 toolWindowManager.getToolWindowBar(ToolWindowAnchor.LEFT).setLength(vThickness); 296 toolWindowManager.getToolWindowBar(ToolWindowAnchor.RIGHT).setLength(vThickness); 297 toolWindowManager.getToolWindowBar(ToolWindowAnchor.BOTTOM).setLength(hThickness); 298 toolWindowManager.getToolWindowBar(ToolWindowAnchor.TOP).setLength(hThickness); 297 299 } 298 300 } 299 301 } -
src/main/java/org/sophie2/main/layout/mydoggy/mdcustomization/SophieTabButtonUI.java
52 52 //XXX UGLY bugfix --peko 53 53 if(this.toolWindow.getAnchor().equals(ToolWindowAnchor.BOTTOM) || 54 54 this.toolWindow.getAnchor().equals(ToolWindowAnchor.TOP)) { 55 Dimension size = new Dimension(100, 35);55 Dimension size = new Dimension(100, 25); 56 56 c.setSize(size); 57 57 c.setPreferredSize(size); 58 58 } … … 74 74 Dimension size = null; 75 75 76 76 if(this.skinUpdater.tabButtonThickness().get() != null) { 77 size = new Dimension(100, this.skinUpdater.tabButtonThickness().get() - 4);77 size = new Dimension(100, this.skinUpdater.tabButtonThickness().get()); 78 78 } else { 79 size = new Dimension(100, 35);79 size = new Dimension(100, 25); 80 80 } 81 81 82 82 c.setSize(size); -
src/main/java/org/sophie2/main/layout/mydoggy/MDManageable.java
25 25 public final static String MYDOGGY_BOOLEAN_COLORED_UI = "colored-ui"; 26 26 27 27 /** 28 * ID used for skin record customizing 29 * the width/height of vertical/horizontal tab buttons. 28 * ID used for skin record customizing the width of vertical tab buttons. 29 */ 30 public final static String MYDOGGY_V_TAB_BUTTON_THICKNESS = "vert-tab-button-thickness"; 31 32 /** 33 * ID used for skin record customizing the height of horizontal tab buttons. 30 34 */ 31 public final static String MYDOGGY_TAB_BUTTON_THICKNESS = "tab-button-thickness"; 35 public final static String MYDOGGY_H_TAB_BUTTON_THICKNESS = "hor-tab-button-thickness"; 36 32 37 33 38 /** 34 39 * Obtains the tool window manager of the compound element. -
src/main/java/org/sophie2/main/layout/mydoggy/mdcustomization/SophieToolWindowBar.java
1 1 package org.sophie2.main.layout.mydoggy.mdcustomization; 2 2 3 import info.clearthought.layout.TableLayoutConstants; 3 4 import info.clearthought.layout.TableLayoutConstraints; 4 5 5 6 import java.awt.Component; … … 48 49 49 50 @Override 50 51 protected void initComponents() { 52 51 53 this.splitPane.setName(this.anchor.toString()); 52 54 this.splitPane.setFocusCycleRoot(true); 53 55 … … 64 66 this.horizontal = false; 65 67 this.representativeButtonsPanel.setLayout( 66 68 this.representativeButtonsPanelLayout = new ExtendedTableLayout( 67 new double[][]{{ 4, getLength()-4, 0}, {TOP_PADDING}}69 new double[][]{{TableLayoutConstants.FILL}, {TOP_PADDING}} 68 70 ) 69 71 ); 70 72 break; … … 72 74 this.horizontal = false; 73 75 this.representativeButtonsPanel.setLayout( 74 76 this.representativeButtonsPanelLayout = new ExtendedTableLayout( 75 new double[][]{{ 0, getLength()-4, 4}, {TOP_PADDING}}77 new double[][]{{TableLayoutConstants.FILL}, {TOP_PADDING}} 76 78 ) 77 79 ); 78 80 this.orientation = JSplitPane.VERTICAL_SPLIT; … … 81 83 this.horizontal = true; 82 84 this.representativeButtonsPanel.setLayout( 83 85 this.representativeButtonsPanelLayout = new ExtendedTableLayout( 84 new double[][]{{0}, { 4, getLength()-4, 0}}86 new double[][]{{0}, {TableLayoutConstants.FILL}} 85 87 ) 86 88 ); 87 89 this.orientation = JSplitPane.HORIZONTAL_SPLIT; … … 120 122 int newCol1 = constraints.col1 + 2; 121 123 this.representativeButtonsPanelLayout.setConstraints(component, 122 124 new TableLayoutConstraints( 123 newCol1 + ", 1,"125 newCol1 + ",0," 124 126 )); 125 127 126 128 olds.put(newCol1, this.representativeButtonsPanelLayout.getColumn(newCol1)); … … 132 134 } 133 135 } 134 136 this.representativeButtonsPanelLayout.setColumn(finalCol, width); 135 this.representativeButtonsPanel.add(representativeAnchor, (index * 2 + 2) + ", 1");137 this.representativeButtonsPanel.add(representativeAnchor, (index * 2 + 2) + ",0"); 136 138 } else 137 this.representativeButtonsPanel.add(representativeAnchor, (this.representativeButtonsPanelLayout.getNumColumn() - 1) + ", 1");139 this.representativeButtonsPanel.add(representativeAnchor, (this.representativeButtonsPanelLayout.getNumColumn() - 1) + ",0"); 138 140 } else { 139 141 int height = Math.max(representativeAnchor.getHeight(), 140 142 Math.max(representativeAnchor.getPreferredSize().height, … … 159 161 int newRow1 = constraints.row1 + 2; 160 162 this.representativeButtonsPanelLayout.setConstraints(component, 161 163 new TableLayoutConstraints( 162 " 1," + newRow1164 "0," + newRow1 163 165 )); 164 166 165 167 olds.put(newRow1, this.representativeButtonsPanelLayout.getRow(newRow1)); … … 175 177 } else 176 178 this.representativeButtonsPanelLayout.setRow(finalRow, height); 177 179 178 this.representativeButtonsPanel.add(representativeAnchor, " 1," + (index * 2 + 2));180 this.representativeButtonsPanel.add(representativeAnchor, "0," + (index * 2 + 2)); 179 181 } else 180 this.representativeButtonsPanel.add(representativeAnchor, " 1," + (this.representativeButtonsPanelLayout.getNumRow() - 1));182 this.representativeButtonsPanel.add(representativeAnchor, "0," + (this.representativeButtonsPanelLayout.getNumRow() - 1)); 181 183 } 182 184 SwingUtil.repaint(this.toolScrollBar); 183 185 } -
src/main/java/org/sophie2/main/layout/mydoggy/MDTab.java
56 56 part.add(MDColorId.TAB_COLOR_START.getSkinId(), DEFAULT_COLOR); 57 57 part.add(MDColorId.TITLE_BAR_COLOR_END.getSkinId(), DEFAULT_COLOR); 58 58 part.add(MDColorId.TITLE_BAR_COLOR_START.getSkinId(), DEFAULT_COLOR); 59 part.add(MYDOGGY_ TAB_BUTTON_THICKNESS, 23);59 part.add(MYDOGGY_V_TAB_BUTTON_THICKNESS, 30); 60 60 61 61 } 62 62