equal
deleted
inserted
replaced
156 c.getWidth() == tb.getWidth()); |
156 c.getWidth() == tb.getWidth()); |
157 } |
157 } |
158 return false; |
158 return false; |
159 } |
159 } |
160 |
160 |
|
161 /** |
|
162 * Constructs an instance of {@code MetalToolBarUI}. |
|
163 * |
|
164 * @param c a component |
|
165 * @return an instance of {@code MetalToolBarUI} |
|
166 */ |
161 public static ComponentUI createUI( JComponent c ) |
167 public static ComponentUI createUI( JComponent c ) |
162 { |
168 { |
163 return new MetalToolBarUI(); |
169 return new MetalToolBarUI(); |
164 } |
170 } |
165 |
171 |
267 protected MouseInputListener createDockingListener( ) |
273 protected MouseInputListener createDockingListener( ) |
268 { |
274 { |
269 return new MetalDockingListener( toolBar ); |
275 return new MetalDockingListener( toolBar ); |
270 } |
276 } |
271 |
277 |
|
278 /** |
|
279 * Sets the offset of the mouse cursor inside the DragWindow. |
|
280 * |
|
281 * @param p the offset |
|
282 */ |
272 protected void setDragOffset(Point p) { |
283 protected void setDragOffset(Point p) { |
273 if (!GraphicsEnvironment.isHeadless()) { |
284 if (!GraphicsEnvironment.isHeadless()) { |
274 if (dragWindow == null) { |
285 if (dragWindow == null) { |
275 dragWindow = createDragWindow(toolBar); |
286 dragWindow = createDragWindow(toolBar); |
276 } |
287 } |
344 this.lastMenuBar = lastMenuBar; |
355 this.lastMenuBar = lastMenuBar; |
345 } |
356 } |
346 } |
357 } |
347 } |
358 } |
348 |
359 |
349 // No longer used. Cannot remove for compatibility reasons |
360 /** |
|
361 * No longer used. The class cannot be removed for compatibility reasons. |
|
362 */ |
350 protected class MetalContainerListener |
363 protected class MetalContainerListener |
351 extends BasicToolBarUI.ToolBarContListener {} |
364 extends BasicToolBarUI.ToolBarContListener {} |
352 |
365 |
353 // No longer used. Cannot remove for compatibility reasons |
366 /** |
|
367 * No longer used. The class cannot be removed for compatibility reasons. |
|
368 */ |
354 protected class MetalRolloverListener |
369 protected class MetalRolloverListener |
355 extends BasicToolBarUI.PropertyListener {} |
370 extends BasicToolBarUI.PropertyListener {} |
356 |
371 |
|
372 /** |
|
373 * {@code DockingListener} for {@code MetalToolBarUI}. |
|
374 */ |
357 protected class MetalDockingListener extends DockingListener { |
375 protected class MetalDockingListener extends DockingListener { |
358 private boolean pressedInBumps = false; |
376 private boolean pressedInBumps = false; |
359 |
377 |
|
378 /** |
|
379 * Constructs the {@code MetalDockingListener}. |
|
380 * |
|
381 * @param t an instance of {@code JToolBar} |
|
382 */ |
360 public MetalDockingListener(JToolBar t) { |
383 public MetalDockingListener(JToolBar t) { |
361 super(t); |
384 super(t); |
362 } |
385 } |
363 |
386 |
364 public void mousePressed(MouseEvent e) { |
387 public void mousePressed(MouseEvent e) { |