Changeset 5618
- Timestamp:
- 09/18/08 14:50:31 (2 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola
- Files:
-
- 1 added
- 1 removed
- 2 modified
-
agents/measurement/util/ui/ColourIcon.java (deleted)
-
agents/measurement/util/ui/ColourListRenderer.java (modified) (4 diffs)
-
env/data/views/calls/ThumbnailSetLoader.java (modified) (2 diffs)
-
util/ui/ColourIcon.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/measurement/util/ui/ColourListRenderer.java
r5032 r5618 37 37 38 38 //Application-internal dependencies 39 import org.openmicroscopy.shoola.util.ui.ColourIcon; 39 40 40 41 /** … … 58 59 { 59 60 60 /** Create the colouricon which will hold the colours. */ 61 private static ColourIcon icon = new ColourIcon(15, 15); 61 /** The gap between the icon and the text. */ 62 private static final int GAP = 20; 63 64 /** Create the icon which will hold the colours. */ 65 private static ColourIcon icon;// = new ColourIcon(15, 15); 62 66 63 67 /** Border colour of the cell when the icon is selected. */ 64 private Border lineBorder = BorderFactory.createLineBorder(Color.gray, 1);68 private Border lineBorder; 65 69 66 70 /** Border colour of the cell when the icon is not selected. */ 67 private Border emptyBorder = BorderFactory.createEmptyBorder(2, 2, 2, 2);71 private Border emptyBorder; 68 72 73 74 69 75 /** 70 76 * Creates a new instance. … … 76 82 setHorizontalAlignment(CENTER); 77 83 setVerticalAlignment(CENTER); 84 icon = new ColourIcon(12, 12); 85 lineBorder = BorderFactory.createLineBorder(Color.gray, 1); 86 emptyBorder = BorderFactory.createEmptyBorder(2, 2, 2, 2); 78 87 } 79 88 80 89 /** 81 * Overridden method 90 * Overridden method to set the color icon. 82 91 * @see ListCellRenderer#getListCellRendererComponent(JList, Object, int, 83 92 * boolean, boolean) 84 93 */ 85 public Component getListCellRendererComponent(JList list, 86 Object value, 87 int index, 88 boolean isSelected, 89 boolean hasFocus) 94 public Component getListCellRendererComponent(JList list, Object value, 95 int index, boolean isSelected, boolean hasFocus) 90 96 { 91 97 Object [] array = (Object[]) value; … … 95 101 96 102 setIcon(icon); 97 this.setVerticalAlignment(SwingConstants.CENTER);98 this.setIconTextGap(40);103 setVerticalAlignment(SwingConstants.CENTER); 104 setIconTextGap(GAP); 99 105 setText((String) array[1]); 100 106 if (isSelected) -
trunk/SRC/org/openmicroscopy/shoola/env/data/views/calls/ThumbnailSetLoader.java
r5615 r5618 117 117 if (pxd == null) 118 118 return Factory.createDefaultImageThumbnail(); 119 /*120 int sizeX = maxLength, sizeY = maxLength;121 122 123 double pixSizeX = pxd.getSizeX();124 double pixSizeY = pxd.getSizeY();125 double ratio = pixSizeX/pixSizeY;126 if (ratio < 1) sizeX *= ratio;127 else if (ratio > 1 && ratio != 0) sizeY *= 1/ratio;128 Dimension d = Factory.computeThumbnailSize(maxLength, maxLength,129 pxd.getSizeX(), pxd.getSizeY());130 131 132 return Factory.createDefaultImageThumbnail(sizeX, sizeY);133 */134 119 Dimension d = Factory.computeThumbnailSize(maxLength, maxLength, 135 120 pxd.getSizeX(), pxd.getSizeY()); … … 143 128 private void computeFetchSize() 144 129 { 145 int value = (Integer) context.lookup(LookupNames.THUMBNAIL_FETCH_SZ); 130 int value = -1; 131 Object fSize = context.lookup(LookupNames.THUMBNAIL_FETCH_SZ); 132 if (fSize == null || !(fSize instanceof Integer)) { 133 context.getLogger().warn(this, "Thumbnail fetching size not set"); 134 value = (Integer) fSize; 135 } 146 136 if (value <= 0) value = FETCH_SIZE; 147 137 UserCredentials uc = 148 138 (UserCredentials) context.lookup(LookupNames.USER_CREDENTIALS); 149 139 double f = 0; 140 Object fSpeed = null; 150 141 switch (uc.getSpeedLevel()) { 151 142 case UserCredentials.MEDIUM: 152 f = (Double)context.lookup(143 fSpeed = context.lookup( 153 144 LookupNames.THUMBNAIL_FETCH_MEDIUM_SPEED); 154 145 if (fSpeed == null || !(fSpeed instanceof Double)) { 146 context.getLogger().warn(this, "Thumbnail " + 147 "fetching factor not set"); 148 f = (Double) fSpeed; 149 } 155 150 if (f <= 0 || f > 1) f = FETCH_MEDIUM_SPEED; 156 151 fetchSize = (int) (value*f); 157 152 break; 158 153 case UserCredentials.LOW: 159 f = (Double)context.lookup(154 fSpeed = context.lookup( 160 155 LookupNames.THUMBNAIL_FETCH_LOW_SPEED); 156 if (fSpeed == null || !(fSpeed instanceof Double)) { 157 context.getLogger().warn(this, "Thumbnail " + 158 "fetching factor not set"); 159 f = (Double) fSpeed; 160 } 161 161 if (f <= 0 || f > 1) f = FETCH_LOW_SPEED; 162 162 fetchSize = (int) (value*f);
