Examples of IconManager


Examples of bibliothek.gui.dock.util.IconManager

    }
   
    @Override
    public void install( DockController controller ) {
        super.install( controller );
        IconManager manager = controller.getIcons();
        Map<String, Icon> icons = DockUtilities.loadIcons(
                "data/bibliothek/gui/dock/common/icons/eclipse/icons.ini", null, CEclipseTheme.class.getClassLoader() );
        for( Map.Entry<String, Icon> entry : icons.entrySet() ){
            manager.setIconTheme( entry.getKey(), entry.getValue() );
        }
        ActionViewConverter converter = controller.getActionViewConverter();
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.TITLE, new EclipsePanelPopupGenerator());
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.MENU, new PanelMenuGenerator() );
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.DROP_DOWN, new PanelDropDownGenerator() );
View Full Code Here

Examples of bibliothek.gui.dock.util.IconManager

    }
   
    @Override
    public void install( DockController controller ) {
        super.install( controller );
        IconManager manager = controller.getIcons();
        Map<String, Icon> icons = DockUtilities.loadIcons(
                "data/bibliothek/gui/dock/common/icons/bubble/icons.ini", null, CBubbleTheme.class.getClassLoader() );
        for( Map.Entry<String, Icon> entry : icons.entrySet() ){
            manager.setIconTheme( entry.getKey(), entry.getValue() );
        }
        ActionViewConverter converter = controller.getActionViewConverter();
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.TITLE, new BubblePanelPopupGenerator());
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.MENU, new PanelMenuGenerator() );
      converter.putTheme( CPanelPopup.PANEL_POPUP, ViewTarget.DROP_DOWN, new PanelDropDownGenerator() );
View Full Code Here

Examples of com.eteks.sweethome3d.swing.IconManager

  private final int HEIGHT = 32;
 
  public void testIconManager()
      throws NoSuchFieldException, IllegalAccessException, InterruptedException, BrokenBarrierException, ClassNotFoundException {
    // Stop iconsLoader of iconManager
    IconManager iconManager = IconManager.getInstance();
    iconManager.clear();
    // Replace icon manager by an executor that controls the start of a task with a barrier
    final CyclicBarrier iconLoadingStartBarrier = new CyclicBarrier(2);
    final ThreadPoolExecutor replacingIconsLoader =
      new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()) {
        @Override
        protected void beforeExecute(Thread t, Runnable r) {
          super.beforeExecute(t, r);
          awaitBarrier(iconLoadingStartBarrier);
        }
    };
    // Redirect rejected tasks on iconsLoader to the replacing executor
    TestUtilities.setField(iconManager, "iconsLoader", replacingIconsLoader);
   
    // Test icon loading on a good image
    testIconLoading(getClass().getResource("resources/test.png"), true, iconLoadingStartBarrier);
    // Test icon loading on a content that doesn't an image
    testIconLoading(getClass().getResource("IconManagerTest.class"), false, iconLoadingStartBarrier);

    Class iconProxyClass = Class.forName(iconManager.getClass().getName() + "$IconProxy");
    URLContent waitIconContent =
        (URLContent)TestUtilities.getField(iconManager, "waitIconContent");
    URLContent errorIconContent =
        (URLContent)TestUtilities.getField(iconManager, "errorIconContent");

    // Check waitIcon is loaded directly without proxy
    Icon waitIcon = iconManager.getIcon(waitIconContent, HEIGHT, null);
    assertNotSame("Wait icon loaded with IconProxy", waitIcon.getClass(), iconProxyClass);

    // Check errorIcon is loaded directly without proxy
    Icon errorIcon = iconManager.getIcon(errorIconContent, HEIGHT, null);
    assertNotSame("Error icon loaded with IconProxy", errorIcon.getClass(), iconProxyClass);

    // For other tests, replace again iconLoader by an executor that let icon loading complete normally
    iconManager.clear();
  }
View Full Code Here

Examples of com.eteks.sweethome3d.swing.IconManager

  /**
   * Test how an icon is loaded by IconManager.
   */
  private void testIconLoading(URL iconURL, boolean goodIcon, CyclicBarrier iconLoadingStartBarrier)
      throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InterruptedException, BrokenBarrierException {
    IconManager iconManager = IconManager.getInstance();
    Class iconProxyClass = Class.forName(iconManager.getClass().getName() + "$IconProxy");
   
    URLContent waitIconContent =
        (URLContent)TestUtilities.getField(iconManager, "waitIconContent");
    URLContent errorIconContent =
        (URLContent)TestUtilities.getField(iconManager, "errorIconContent");
   
    final CyclicBarrier waitingComponentBarrier = new CyclicBarrier(2);
    // A dummy waiting component that waits on a barrier in its repaint method
    Component waitingComponent = new Component() {
      public void repaint() {
        awaitBarrier(waitingComponentBarrier);
      }
    };

    Content iconContent = new URLContent(iconURL);
    Icon icon = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
    assertEquals("Icon not equal to wait icon while loading", waitIconContent.getURL(), icon);

    // Let iconManager load the iconContent
    iconLoadingStartBarrier.await();
    // Wait iconContent loading completion
    waitingComponentBarrier.await();
    if (goodIcon) {
      assertEquals("Icon not equal to icon read from resource", iconURL, icon);
    } else {
      assertEquals("Wrong icon not equal to errorIcon", errorIconContent.getURL(), icon);
    }
   
    // Check icon is loaded with proxy
    assertSame("Icon not loaded with IconProxy", icon.getClass(), iconProxyClass);

    // Check that icon is stored in cache
    Icon iconFromCache = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
    assertSame("Test icon reloaded", icon, iconFromCache);
  }
View Full Code Here

Examples of net.suberic.util.gui.IconManager

     * Signature bad
     * Signature failed verification
     * ...and maybe more.
     */

    IconManager iconManager = Pooka.getUIFactory().getIconManager();
   
    notEncryptedIcon = new ImageIcon();
    //notEncryptedIcon = iconManager.getIcon(Pooka.getProperty(key + ".notEncryptedIcon", "UnLock"));
    uncheckedEncryptedIcon = iconManager.getIcon(Pooka.getProperty(key + ".uncheckedEncryptedIcon", "Lock"));
    decryptedSuccessfullyIcon = iconManager.getIcon(Pooka.getProperty(key + ".decryptedSuccessfullyIcon", "OpenLock"));
    decryptedUnsuccessfullyIcon = iconManager.getIcon(Pooka.getProperty(key + ".decryptedUnsuccessfullyIcon", "Bomb"));
    uncheckedSignedIcon = iconManager.getIcon(Pooka.getProperty(key + ".uncheckedSignedIcon", "Draw"));
   
    notSignedIcon = new ImageIcon();
    //notSignedIcon = iconManager.getIcon(Pooka.getProperty(key + ".notSignedIcon", "EnvelopeOpen"));
    signatureVerifiedIcon = iconManager.getIcon(Pooka.getProperty(key + ".signatureVerifiedIcon", "Check"));
    signatureBadIcon = iconManager.getIcon(Pooka.getProperty(key + ".signatureBadIcon", "Caution"));
    signatureFailedVerificationIcon = iconManager.getIcon(Pooka.getProperty(key + ".signatureFailedVerificationIcon", "Caution"));
  }
View Full Code Here

Examples of net.suberic.util.gui.IconManager

  /**
   * Loads the images for the ConnectionMonitor.
   */
  private void loadImages() {
    IconManager iconManager = Pooka.getUIFactory().getIconManager();
    connectedImage = iconManager.getIcon(Pooka.getProperty("ConnectionMonitor.connectedIcon", "ConnectionMonitor.ConnectedIcon"));
    disconnectedImage = iconManager.getIcon(Pooka.getProperty("ConnectionMonitor.disconnectedIcon", "ConnectionMonitor.DisconnectedIcon"));
    unavailableImage = iconManager.getIcon(Pooka.getProperty("ConnectionMonitor.unavailableIcon", "ConnectionMonitor.UnavailableIcon"));
  }
View Full Code Here

Examples of net.suberic.util.gui.IconManager

  /**
   * Sets up the images to use for the tray icon and for the main window.
   */
  void setupImages() {
    IconManager iconManager;
    if (Pooka.getUIFactory() != null) {
      iconManager = Pooka.getUIFactory().getIconManager();
    } else {
      iconManager = IconManager.getIconManager(Pooka.getResources(), "IconManager._default");
    }


    mStandardIcon = iconManager.getIcon(Pooka.getProperty("Pooka.standardIcon", "PookaIcon"));
    setCurrentIcon(mStandardIcon);

    mStandardTrayIcon = iconManager.getIcon(Pooka.getProperty("Pooka.standardTrayIcon", "PookaTrayIcon"));

    mNewMessageIcon = iconManager.getIcon(Pooka.getProperty("Pooka.newMessageIcon", "EnvelopeOpen"));

    mNewMessageTrayIcon = iconManager.getIcon(Pooka.getProperty("Pooka.newMessageIcon", "NewMessageTray"));

  }
View Full Code Here

Examples of net.suberic.util.gui.IconManager

    JLabel userProfileLabel = new JLabel(Pooka.getProperty("UserProfile.label","User:"), SwingConstants.RIGHT);
    userProfileLabel.setPreferredSize(new Dimension(75,userProfileLabel.getPreferredSize().height));
    JComboBox profileCombo = new JComboBox(new Vector(Pooka.getPookaManager().getUserProfileManager().getUserProfileList()));


    IconManager iconManager = Pooka.getUIFactory().getIconManager();

    ImageIcon headerIcon = iconManager.getIcon(Pooka.getProperty("NewMessage.customHeader.button", "Hammer"));
    if (headerIcon != null) {
      java.awt.Image headerImage = headerIcon.getImage();
      headerImage = headerImage.getScaledInstance(15, 15, java.awt.Image.SCALE_SMOOTH);
      headerIcon.setImage(headerImage);
      customHeaderButton = new JToggleButton(headerIcon);
View Full Code Here

Examples of net.suberic.util.gui.IconManager

    returnValue.add(customInputPanel, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

    IconManager iconManager = Pooka.getUIFactory().getIconManager();

    ImageIcon headerIcon = iconManager.getIcon(Pooka.getProperty("NewMessage.customHeader.add.button", "Plus"));

    JButton headerButton = null;

    if (headerIcon != null) {
      headerButton = new JButton(headerIcon);
View Full Code Here

Examples of net.suberic.util.gui.IconManager

      }, "Pooka.guiType");

    mPookaManager.getResources().addValueChangeListener(new net.suberic.util.ValueChangeListener() {
        public void valueChanged(String changedValue) {
          PookaUIFactory factory = Pooka.getUIFactory();
          IconManager iconManager = IconManager.getIconManager(Pooka.getResources(), "IconManager._default");
          factory.setIconManager(iconManager);
          factory.setEditorFactory(new PropertyEditorFactory(Pooka.getResources(), iconManager, Pooka.getPookaManager().getHelpBroker()));
        }
      }, "IconManager._default");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.