Package org.noos.xing.mydoggy.plaf.ui.look

Examples of org.noos.xing.mydoggy.plaf.ui.look.MyDoggyResourceManager$ToolWindowTitleButtonComponentCreator


        resourceManager.putProperty("drag.icon.transparency.enabled", "false");
        resourceManager.putProperty("drag.icon.useDefault", "true");
        resourceManager.putBoolean("drag.toolwindow.asTab", true);
*/

        MyDoggyResourceManager myDoggyResourceManager = (MyDoggyResourceManager) myDoggyToolWindowManager.getResourceManager();

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_START, Color.BLUE);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_END, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_START, Color.BLACK);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_END, Color.GREEN.darker());
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_SELECTED, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_UNSELECTED, Color.DARK_GRAY);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_START, Color.RED);
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_END, Color.ORANGE);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_FOREGROUND, Color.BLUE);
*/

/*
        myDoggyResourceManager.putComponentUICreator(MyDoggyKeySpace.TOOL_WINDOW_TITLE_BAR_UI,
                                                     new ObjectCreator<ComponentUI>() {
                                                         public ComponentUI create(Context context) {
                                                             return new ToolWindowTitleBarUI(context.get(ToolWindowDescriptor.class) ,
                                                                                             context.get(ToolWindowContainer.class)) {
                                                                 protected void updateToolWindowTitleBar(Graphics g, JComponent c, Color backgroundStart, Color backgroundEnd, Color idBackgroundColor, Color idColor) {
                                                                     Rectangle r = c.getBounds();
                                                                     r.x = r.y = 0;

                                                                     GraphicsUtil.fillRect(g, r,
                                                                                           backgroundStart, backgroundEnd,
                                                                                           null,
                                                                                           GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                     if (descriptor.getDockedTypeDescriptor().isIdVisibleOnTitleBar() ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_FREE ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {

                                                                         String id = resourceManager.getUserString(descriptor.getToolWindow().getId());
                                                                         r.width = g.getFontMetrics().stringWidth(id) + 8;

                                                                         int halfHeigh = (r.height / 2);
                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               new Polygon(new int[]{r.x, r.x + r.width - halfHeigh, r.x + r.width - halfHeigh, r.x},
                                                                                                           new int[]{r.y, r.y, r.y + r.height, r.y + r.height},
                                                                                                           4),
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);


                                                                         Polygon polygon = new Polygon();
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y);
                                                                         polygon.addPoint(r.x + r.width - halfHeigh + 8, r.y + (r.height / 2));
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y + r.height);

                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               polygon,
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                         g.setColor(idColor);
                                                                         g.drawString(id, r.x + 2, r.y + g.getFontMetrics().getAscent());
                                                                     }
                                                                 }
                                                             };
                                                         }
                                                     });

        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new ObjectCreator() {
                                                      public Object create(Context context) {
                                                          return new MenuTitleBarButtons(
                                                                  context.get(ToolWindowDescriptor.class),
                                                                  context.get(ToolWindowContainer.class)
                                                          );
                                                      }
                                                  });
*/

        myDoggyResourceManager.putInstanceCreator(ParentOfQuestion.class, new ObjectCreator() {
            public Object create(Context context) {
                return new CustomParentOfQuestion(context.get(Component.class),
                                                  context.get(ToolWindow.class));
            }
        });
View Full Code Here


*/
        resourceManager.putProperty("ContentManagerUI.ContentManagerUiListener.import", "true");
        resourceManager.putProperty("drag.icon.transparency.enabled", "false");
        resourceManager.putProperty("drag.icon.useDefault", "true");

        MyDoggyResourceManager myDoggyResourceManager = (MyDoggyResourceManager) myDoggyToolWindowManager.getResourceManager();

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_START, Color.BLUE);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_END, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_START, Color.BLACK);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_END, Color.GREEN.darker());
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_SELECTED, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_UNSELECTED, Color.DARK_GRAY);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_START, Color.RED);
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_END, Color.ORANGE);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_FOREGROUND, Color.BLUE);
*/

/*
        myDoggyResourceManager.putComponentUICreator(MyDoggyKeySpace.TOOL_WINDOW_TITLE_BAR_UI,
                                                     new MyDoggyResourceManager.ComponentUICreator() {

                                                         public ComponentUI createComponentUI(ToolWindowManager manager, ResourceManager resourceManager, Object... args) {
                                                             return new ToolWindowTitleBarUI((ToolWindowDescriptor) args[0],
                                                                                             (DockedContainer) args[1]) {
                                                                 protected void updateToolWindowTitleBar(Graphics g, JComponent c, Color backgroundStart, Color backgroundEnd, Color idBackgroundColor, Color idColor) {
                                                                     Rectangle r = c.getBounds();
                                                                     r.x = r.y = 0;

                                                                     GraphicsUtil.fillRect(g, r,
                                                                                           backgroundStart, backgroundEnd,
                                                                                           null,
                                                                                           GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                     if (descriptor.getDockedTypeDescriptor().isIdVisibleOnTitleBar() ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_FREE ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {

                                                                         String id = resourceManager.getUserString(descriptor.getToolWindow().getId());
                                                                         r.width = g.getFontMetrics().stringWidth(id) + 8;

                                                                         int halfHeigh = (r.height / 2);
                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               new Polygon(new int[]{r.x, r.x + r.width - halfHeigh, r.x + r.width - halfHeigh, r.x},
                                                                                                           new int[]{r.y, r.y, r.y + r.height, r.y + r.height},
                                                                                                           4),
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);


                                                                         Polygon polygon = new Polygon();
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y);
                                                                         polygon.addPoint(r.x + r.width - halfHeigh + 8, r.y + (r.height / 2));
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y + r.height);

                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               polygon,
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                         g.setColor(idColor);
                                                                         g.drawString(id, r.x + 2, r.y + g.getFontMetrics().getAscent());
                                                                     }
                                                                 }
                                                             };
                                                         }
                                                     });
*/
/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/

/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/
        myDoggyResourceManager.putInstanceCreator(ParentOfQuestion.class, new ObjectCreator() {
            public Object create(Context context) {
                return new CustomParentOfQuestion(context.get(Component.class),
                                                  context.get(ToolWindow.class));
            }
        });
View Full Code Here

        try {
            resourceManager = (ResourceManager) SwingUtil.newObject(uiClassLoader, className);
        } catch (Exception e) {
            e.printStackTrace();

            resourceManager = new MyDoggyResourceManager();
        }

        resourceManager.setClassloader(uiClassLoader);
        resourceManager.setLocale(locale);
View Full Code Here

        }
        try {
            this.resourceManager = (ResourceManager) SwingUtil.newObject(className);
        } catch (Exception e) {
            e.printStackTrace();
            this.resourceManager = new MyDoggyResourceManager();
        }
        resourceManager.setLocale(locale);
    }
View Full Code Here

/*
        resourceManager.putProperty("drag.icon.transparency.enabled", "false");
        resourceManager.putProperty("drag.icon.useDefault", "true");
*/

        MyDoggyResourceManager myDoggyResourceManager = (MyDoggyResourceManager) myDoggyToolWindowManager.getResourceManager();

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_START, Color.BLUE);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_END, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_START, Color.BLACK);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_END, Color.GREEN.darker());
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_SELECTED, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_UNSELECTED, Color.DARK_GRAY);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_START, Color.RED);
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_END, Color.ORANGE);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_FOREGROUND, Color.BLUE);
*/

/*
        myDoggyResourceManager.putComponentUICreator(MyDoggyKeySpace.TOOL_WINDOW_TITLE_BAR_UI,
                                                     new MyDoggyResourceManager.ComponentUICreator() {

                                                         public ComponentUI createComponentUI(ToolWindowManager manager, ResourceManager resourceManager, Object... args) {
                                                             return new ToolWindowTitleBarUI((ToolWindowDescriptor) args[0],
                                                                                             (DockedContainer) args[1]) {
                                                                 protected void updateToolWindowTitleBar(Graphics g, JComponent c, Color backgroundStart, Color backgroundEnd, Color idBackgroundColor, Color idColor) {
                                                                     Rectangle r = c.getBounds();
                                                                     r.x = r.y = 0;

                                                                     GraphicsUtil.fillRect(g, r,
                                                                                           backgroundStart, backgroundEnd,
                                                                                           null,
                                                                                           GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                     if (descriptor.getDockedTypeDescriptor().isIdVisibleOnTitleBar() ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_FREE ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {

                                                                         String id = resourceManager.getUserString(descriptor.getToolWindow().getId());
                                                                         r.width = g.getFontMetrics().stringWidth(id) + 8;

                                                                         int halfHeigh = (r.height / 2);
                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               new Polygon(new int[]{r.x, r.x + r.width - halfHeigh, r.x + r.width - halfHeigh, r.x},
                                                                                                           new int[]{r.y, r.y, r.y + r.height, r.y + r.height},
                                                                                                           4),
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);


                                                                         Polygon polygon = new Polygon();
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y);
                                                                         polygon.addPoint(r.x + r.width - halfHeigh + 8, r.y + (r.height / 2));
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y + r.height);

                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               polygon,
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                         g.setColor(idColor);
                                                                         g.drawString(id, r.x + 2, r.y + g.getFontMetrics().getAscent());
                                                                     }
                                                                 }
                                                             };
                                                         }
                                                     });
*/
/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/

/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/
        myDoggyResourceManager.putInstanceCreator(ParentOfQuestion.class, new MyDoggyResourceManager.InstanceCreator() {
            public Object createComponent(Object... args) {
                return new CustomParentOfQuestion((Component) args[0], (ToolWindow) args[1]);
            }
        });
    }
View Full Code Here

*/
        resourceManager.putProperty("ContentManagerUI.ContentManagerUiListener.import", "true");
        resourceManager.putProperty("drag.icon.transparency.enabled", "false");
        resourceManager.putProperty("drag.icon.useDefault", "true");

        MyDoggyResourceManager myDoggyResourceManager = (MyDoggyResourceManager) myDoggyToolWindowManager.getResourceManager();

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_START, Color.BLUE);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_END, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_START, Color.BLACK);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_END, Color.GREEN.darker());
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_SELECTED, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_UNSELECTED, Color.DARK_GRAY);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_START, Color.RED);
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_END, Color.ORANGE);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_FOREGROUND, Color.BLUE);
*/

/*
        myDoggyResourceManager.putComponentUICreator(MyDoggyKeySpace.TOOL_WINDOW_TITLE_BAR_UI,
                                                     new MyDoggyResourceManager.ComponentUICreator() {

                                                         public ComponentUI createComponentUI(ToolWindowManager manager, ResourceManager resourceManager, Object... args) {
                                                             return new ToolWindowTitleBarUI((ToolWindowDescriptor) args[0],
                                                                                             (DockedContainer) args[1]) {
                                                                 protected void updateToolWindowTitleBar(Graphics g, JComponent c, Color backgroundStart, Color backgroundEnd, Color idBackgroundColor, Color idColor) {
                                                                     Rectangle r = c.getBounds();
                                                                     r.x = r.y = 0;

                                                                     GraphicsUtil.fillRect(g, r,
                                                                                           backgroundStart, backgroundEnd,
                                                                                           null,
                                                                                           GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                     if (descriptor.getDockedTypeDescriptor().isIdVisibleOnTitleBar() ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_FREE ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {

                                                                         String id = resourceManager.getUserString(descriptor.getToolWindow().getId());
                                                                         r.width = g.getFontMetrics().stringWidth(id) + 8;

                                                                         int halfHeigh = (r.height / 2);
                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               new Polygon(new int[]{r.x, r.x + r.width - halfHeigh, r.x + r.width - halfHeigh, r.x},
                                                                                                           new int[]{r.y, r.y, r.y + r.height, r.y + r.height},
                                                                                                           4),
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);


                                                                         Polygon polygon = new Polygon();
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y);
                                                                         polygon.addPoint(r.x + r.width - halfHeigh + 8, r.y + (r.height / 2));
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y + r.height);

                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               polygon,
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                         g.setColor(idColor);
                                                                         g.drawString(id, r.x + 2, r.y + g.getFontMetrics().getAscent());
                                                                     }
                                                                 }
                                                             };
                                                         }
                                                     });
*/
/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/

/*
        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new MyDoggyResourceManager.InstanceCreator() {
                                                      public Object createComponent(Object... args) {
                                                          return new MenuTitleBarButtons(
                                                                  (ToolWindowDescriptor) args[0],
                                                                  (DockedContainer) args[1]
                                                          );
                                                      }
                                                  }
        );
*/
        myDoggyResourceManager.putInstanceCreator(ParentOfQuestion.class, new MyDoggyResourceManager.InstanceCreator() {
            public Object createComponent(Object... args) {
                return new CustomParentOfQuestion((Component) args[0], (ToolWindow) args[1]);
            }
        });
    }
View Full Code Here

        }
        try {
            setResourceManager((ResourceManager) SwingUtil.newObject(className));
        } catch (Exception e) {
            e.printStackTrace();
            setResourceManager(new MyDoggyResourceManager());
        }
        resourceManager.setLocale(locale);
    }
View Full Code Here

        }
        try {
            setResourceManager((ResourceManager) SwingUtil.newObject(className));
        } catch (Exception e) {
            e.printStackTrace();
            setResourceManager(new MyDoggyResourceManager());
        }
        resourceManager.setLocale(locale);
    }
View Full Code Here

        resourceManager.putProperty("drag.icon.transparency.enabled", "false");
        resourceManager.putProperty("drag.icon.useDefault", "true");
        resourceManager.putBoolean("drag.toolwindow.asTab", true);
*/

        MyDoggyResourceManager myDoggyResourceManager = (MyDoggyResourceManager) myDoggyToolWindowManager.getResourceManager();

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_START, Color.BLUE);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_ACTIVE_END, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_START, Color.BLACK);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_BACKGROUND_INACTIVE_END, Color.GREEN.darker());
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_SELECTED, Color.GREEN);
        resourceManager.putColor(MyDoggyKeySpace.TWTB_TAB_FOREGROUND_UNSELECTED, Color.DARK_GRAY);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_START, Color.RED);
        resourceManager.putColor(MyDoggyKeySpace.RAB_BACKGROUND_ACTIVE_END, Color.ORANGE);
*/

/*
        resourceManager.putColor(MyDoggyKeySpace.RAB_FOREGROUND, Color.BLUE);
*/

/*
        myDoggyResourceManager.putComponentUICreator(MyDoggyKeySpace.TOOL_WINDOW_TITLE_BAR_UI,
                                                     new ObjectCreator<ComponentUI>() {
                                                         public ComponentUI create(Context context) {
                                                             return new ToolWindowTitleBarUI(context.get(ToolWindowDescriptor.class) ,
                                                                                             context.get(ToolWindowContainer.class)) {
                                                                 protected void updateToolWindowTitleBar(Graphics g, JComponent c, Color backgroundStart, Color backgroundEnd, Color idBackgroundColor, Color idColor) {
                                                                     Rectangle r = c.getBounds();
                                                                     r.x = r.y = 0;

                                                                     GraphicsUtil.fillRect(g, r,
                                                                                           backgroundStart, backgroundEnd,
                                                                                           null,
                                                                                           GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                     if (descriptor.getDockedTypeDescriptor().isIdVisibleOnTitleBar() ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_FREE ||
                                                                         toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {

                                                                         String id = resourceManager.getUserString(descriptor.getToolWindow().getId());
                                                                         r.width = g.getFontMetrics().stringWidth(id) + 8;

                                                                         int halfHeigh = (r.height / 2);
                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               new Polygon(new int[]{r.x, r.x + r.width - halfHeigh, r.x + r.width - halfHeigh, r.x},
                                                                                                           new int[]{r.y, r.y, r.y + r.height, r.y + r.height},
                                                                                                           4),
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);


                                                                         Polygon polygon = new Polygon();
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y);
                                                                         polygon.addPoint(r.x + r.width - halfHeigh + 8, r.y + (r.height / 2));
                                                                         polygon.addPoint(r.x + r.width - halfHeigh, r.y + r.height);

                                                                         GraphicsUtil.fillRect(g, r,
                                                                                               Color.WHITE,
                                                                                               idBackgroundColor,
                                                                                               polygon,
                                                                                               GraphicsUtil.LEFT_TO_RIGHT_GRADIENT);

                                                                         g.setColor(idColor);
                                                                         g.drawString(id, r.x + 2, r.y + g.getFontMetrics().getAscent());
                                                                     }
                                                                 }
                                                             };
                                                         }
                                                     });

        myDoggyResourceManager.putInstanceCreator(TitleBarButtons.class,
                                                  new ObjectCreator() {
                                                      public Object create(Context context) {
                                                          return new MenuTitleBarButtons(
                                                                  context.get(ToolWindowDescriptor.class),
                                                                  context.get(ToolWindowContainer.class)
                                                          );
                                                      }
                                                  });
*/

        myDoggyResourceManager.putInstanceCreator(ParentOfQuestion.class, new ObjectCreator() {
            public Object create(Context context) {
                return new CustomParentOfQuestion(context.get(Component.class),
                                                  context.get(ToolWindow.class));
            }
        });
View Full Code Here

        }
        try {
            setResourceManager((ResourceManager) SwingUtil.newObject(className));
        } catch (Exception e) {
            e.printStackTrace();
            setResourceManager(new MyDoggyResourceManager());
        }
        resourceManager.setLocale(locale);
    }
View Full Code Here

TOP

Related Classes of org.noos.xing.mydoggy.plaf.ui.look.MyDoggyResourceManager$ToolWindowTitleButtonComponentCreator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.