Changeset 5686
- Timestamp:
- 10/14/08 10:26:04 (7 weeks ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola
- Files:
-
- 1 removed
- 6 modified
-
agents/dataBrowser/DataBrowserTranslator.java (modified) (1 diff)
-
util/ui/NotificationDialog.java (modified) (3 diffs)
-
util/ui/ReferenceFramePanel.java (deleted)
-
util/ui/border/ImageBorder.java (modified) (10 diffs)
-
util/ui/lens/LensComponent.java (modified) (1 diff)
-
util/ui/lens/LensController.java (modified) (1 diff)
-
util/ui/lens/ZoomWindow.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/DataBrowserTranslator.java
r5662 r5686 193 193 return node; 194 194 } 195 196 /**197 * Transforms the images contained in the passed container.198 *199 * @param uo The data object to handle. Mustn't be <code>null</code>.200 * @param userID The id of the current user.201 * @param groupID The id of the group the current user selects when202 * retrieving the data.203 * @return Collection of {@link ImageNode} or <code>null</code>.204 */205 private static Set transformImagesFrom(DataObject uo, long userID,206 long groupID)207 {208 if (uo == null)209 throw new IllegalArgumentException("No Object.");210 Set images = null;211 Set children;212 Iterator i, j;213 DatasetData d;214 if (uo instanceof DatasetData) {215 d = (DatasetData) uo;216 images = transformImages(d.getImages(), userID, groupID);217 } else if (uo instanceof ProjectData) {218 ProjectData pj = (ProjectData) uo;219 children = pj.getDatasets();220 if (children != null) {221 i = children.iterator();222 images = new HashSet();223 while (i.hasNext()) {224 d = (DatasetData) i.next();225 images.addAll(transformImages(d.getImages(),226 userID, groupID));227 }228 }229 } else if (uo instanceof ImageData) {230 images = new HashSet(1);231 if (isReadable(uo, userID, groupID))232 images.add(linkImageTo((ImageData) uo, null));233 }234 return images;235 }236 195 237 196 /** -
trunk/SRC/org/openmicroscopy/shoola/util/ui/NotificationDialog.java
r5429 r5686 41 41 import javax.swing.JPanel; 42 42 43 44 //Third-party libraries 43 45 import layout.TableLayout; 44 45 //Third-party libraries46 46 47 47 //Application-internal dependencies … … 214 214 } 215 215 216 /** 217 * Initialises the UI. 218 * 219 * @param message The message to display. 220 * @param messageIcon The icon laid out next to the message. 221 */ 216 222 private void initiliaze(String message, Icon messageIcon) 217 223 { … … 222 228 buildGUI(message, messageIcon); 223 229 } 230 224 231 /** 225 232 * Creates a new dialog. -
trunk/SRC/org/openmicroscopy/shoola/util/ui/border/ImageBorder.java
r5583 r5686 24 24 25 25 // Java Imports 26 27 26 import java.awt.Component; 28 27 import java.awt.Graphics; … … 39 38 40 39 //Application-internal dependencies 41 42 40 import org.openmicroscopy.shoola.util.image.geom.Factory; 43 41 … … 65 63 { 66 64 67 /** 68 * The Images for the top of the border. 69 */ 70 private Image top_center, top_left, top_right; 71 72 /** 73 * The Images for the left and right sides of the border. 74 */ 75 private Image left_center, right_center; 76 77 /** 78 * The Images for the bottom of the border. 79 */ 80 private Image bottom_center, bottom_left, bottom_right; 65 /** The Image displayed in the centre of the top border. */ 66 private Image top_center; 67 68 /** The Image displayed on the left of the top border. */ 69 private Image top_left; 70 71 /** The Image displayed on the left of the top border. */ 72 private Image top_right; 73 74 /** The image used for the left side of the border. */ 75 private Image left_center; 76 77 /** The image used for the rigth side of the border. */ 78 private Image right_center; 79 80 /** The Image displayed in the centre of the bottom border. */ 81 private Image bottom_center; 82 83 /** The Image displayed on the left of the bottom border. */ 84 private Image bottom_left; 85 86 /** The Image displayed on the right of the bottom border. */ 87 private Image bottom_right; 81 88 82 89 /** … … 85 92 * Insets calculated from the size of the side Images. 86 93 */ 87 private Insets insets;94 private Insets insets; 88 95 89 96 /** … … 103 110 Image bottom_left, Image bottom_center, Image bottom_right) 104 111 { 112 if (top_left == null) 113 throw new IllegalArgumentException("The top left image " + 114 "cannot be null."); 115 if (top_center == null) 116 throw new IllegalArgumentException("The top center image " + 117 "cannot be null."); 118 if (top_right == null) 119 throw new IllegalArgumentException("The top right image " + 120 "cannot be null."); 121 if (left_center == null) 122 throw new IllegalArgumentException("The left center image " + 123 "cannot be null."); 124 if (right_center == null) 125 throw new IllegalArgumentException("The right center image " + 126 "cannot be null."); 127 if (bottom_left == null) 128 throw new IllegalArgumentException("The bottom left image " + 129 "cannot be null."); 130 if (bottom_center == null) 131 throw new IllegalArgumentException("The bottom center image " + 132 "cannot be null."); 133 if (bottom_right == null) 134 throw new IllegalArgumentException("The bottom right image " + 135 "cannot be null."); 105 136 this.top_left = top_left; 106 137 this.top_center = top_center; … … 117 148 * Otherwise, {@link Border#getBorderInsets(Component)} will return 118 149 * Insets calculated from the size of the side Images. 150 * 151 * @param insets The value to set. 119 152 */ 120 153 public void setInsets(Insets insets) … … 127 160 * Unless the insets have been manually set using {@link #setInsets(Insets)} 128 161 * 162 * @see See above. 129 163 * @see Border#getBorderInsets(Component) 130 164 */ 131 165 public Insets getBorderInsets(Component c) 132 166 { 133 if(insets != null) { 134 return insets; 135 } else { 136 return new Insets(top_center.getHeight(null),left_center.getWidth(null), 167 if (insets != null) return insets; 168 return 169 new Insets(top_center.getHeight(null), left_center.getWidth(null), 137 170 bottom_center.getHeight(null), right_center.getWidth(null)); 138 }139 171 } 140 172 … … 144 176 * @see AbstractBorder#paintBorder(Component, Graphics, int, int, int, int) 145 177 */ 146 public void paintBorder(Component c, Graphics g, int x, 147 int y, int width, intheight)148 { 149 Graphics2D g2 = (Graphics2D) g;178 public void paintBorder(Component c, Graphics g, int x, int y, int width, 179 int height) 180 { 181 Graphics2D g2 = (Graphics2D) g; 150 182 151 183 int tlw = top_left.getWidth(null); … … 168 200 int brh = bottom_right.getHeight(null); 169 201 170 fillTexture(g2, top_left, x, y, tlw,tlh);171 fillTexture(g2, top_center, x+tlw, y,width-tlw-trw, tch);172 fillTexture(g2, top_right, x+width-trw, y, trw,trh);173 174 fillTexture(g2, left_center, x, y+tlh, lcw,height-tlh-blh);175 fillTexture(g2, right_center,x+width-rcw, y+trh, rcw, height-trh-brh);176 177 fillTexture(g2, bottom_left, x, y+height-blh, blw,blh);178 fillTexture(g2, bottom_center, x+blw, y+height-bch,width-blw-brw, bch);179 fillTexture(g2, bottom_right, x+width-brw, y+height-brh, brw,brh);202 fillTexture(g2, top_left, x, y, tlw, tlh); 203 fillTexture(g2, top_center, x+tlw, y, width-tlw-trw, tch); 204 fillTexture(g2, top_right, x+width-trw, y, trw, trh); 205 206 fillTexture(g2, left_center, x, y+tlh, lcw, height-tlh-blh); 207 fillTexture(g2, right_center, x+width-rcw, y+trh, rcw, height-trh-brh); 208 209 fillTexture(g2, bottom_left, x, y+height-blh, blw, blh); 210 fillTexture(g2, bottom_center, x+blw, y+height-bch, width-blw-brw, bch); 211 fillTexture(g2, bottom_right, x+width-brw, y+height-brh, brw, brh); 180 212 } 181 213 … … 184 216 * a specified Image. 185 217 * 186 * @param g2 The Graphics2D object to fill187 * @param img The image to paint into the Graphics2D object188 * @param x The x coordinate of the area to paint189 * @param y The y coordinate of the area to paint190 * @param w The width of the area to paint191 * @param h The height of the area to paint192 */ 193 public static void fillTexture(Graphics2D g2, Image img, 194 int x, int y,int w, int h)218 * @param g2 The Graphics2D object to fill 219 * @param img The image to paint into the Graphics2D object 220 * @param x The x coordinate of the area to paint 221 * @param y The y coordinate of the area to paint 222 * @param w The width of the area to paint 223 * @param h The height of the area to paint 224 */ 225 public static void fillTexture(Graphics2D g2, Image img, int x, int y, 226 int w, int h) 195 227 { 196 228 BufferedImage buff = Factory.createImage(img); 197 Rectangle anchor = new Rectangle(x, y,198 img.getWidth(null),img.getHeight(null));229 Rectangle anchor = new Rectangle(x, y, img.getWidth(null), 230 img.getHeight(null)); 199 231 TexturePaint paint = new TexturePaint(buff,anchor); 200 232 g2.setPaint(paint); -
trunk/SRC/org/openmicroscopy/shoola/util/ui/lens/LensComponent.java
r5159 r5686 180 180 lens.addController(lensController); 181 181 lens.setLensColour(lensModel.getLensPreferredColour()); 182 zoomWindow.addController(lensController);183 182 menu = new LensMenu(this); 184 183 lens.setPopupMenu(menu.getPopupMenu()); -
trunk/SRC/org/openmicroscopy/shoola/util/ui/lens/LensController.java
r5014 r5686 22 22 */ 23 23 package org.openmicroscopy.shoola.util.ui.lens; 24 24 25 //Java imports 25 26 import java.awt.Cursor; -
trunk/SRC/org/openmicroscopy/shoola/util/ui/lens/ZoomWindow.java
r5014 r5686 52 52 private ZoomWindowUI zoomWindowUI; 53 53 54 /** Controller which manipulates the lens and zoomWindow images. */55 private LensController lensController;56 57 /** Parent component of the lens and ZoomWindow. */58 private LensComponent lensComponent;59 60 54 /** 61 55 * Constructor of the zoomWindow. This creates an instance of the … … 68 62 ZoomWindow(JFrame parent, LensComponent lensComponent) 69 63 { 70 this.lensComponent = lensComponent;71 64 zoomWindowUI = new ZoomWindowUI(parent, lensComponent); 72 65 } … … 82 75 if (lensComponent == null) 83 76 throw new IllegalArgumentException("No parent."); 84 this.lensComponent = lensComponent;85 77 zoomWindowUI = new ZoomWindowUI(null, lensComponent); 86 }87 88 /**89 * Adds controller to the zoomWindow.90 *91 * @param lensController Reference to the control.92 * Mustn't be <code>null</code>.93 */94 void addController(LensController lensController)95 {96 if (lensController == null)97 throw new IllegalArgumentException("No control.");98 this.lensController = lensController;99 78 } 100 79
