private static void setLookAndFeel(String os) {
   if (os == null) {
     os = System.getProperty("os.name");
   }
   os = os.trim().toLowerCase();
   try {
     if (os.contains("windows")) {
       UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
     } else if (os.contains("mac")) {
       UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
     } else if (os.contains("javametal")) {
       UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
     } else if (os.contains("weblookandfeel")) {
       WebLookAndFeel.install();
     } else {
       UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
     }
   } catch (ClassNotFoundException e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
   } catch (InstantiationException e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
   } catch (IllegalAccessException e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
   } catch (UnsupportedLookAndFeelException e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
   }
 }
Beispiel #2
0
  public static void main(String[] args) {
    JFrame jframe = new JFrame("Thư viện lưu trữ");

    WebLookAndFeel.install();

    jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    jframe.setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());

    SolutionsDataTable model = new SolutionsDataTable();
    LibSolutionsController controller = new LibSolutionsController(model);

    jframe.setContentPane(controller.getView());
    jframe.setSize(900, 400);
    jframe.setVisible(true);
  }
Beispiel #3
0
 public static void init() {
   WebLookAndFeel.install();
   WebFrame baseFrame =
       new WebFrame("Almöhi - <Hier sollte der Host stehen, zudem eine Verbindung besteht>");
   WebTabbedPane tabbedPane = new WebTabbedPane(WebTabbedPane.TOP);
   WebTextArea textArea = new WebTextArea();
   textArea.setEditable(false);
   tabbedPane.addTab("Bla", new WebLabel("Führerhauptquartier"));
   tabbedPane.addTab("Bla2", new WebLabel("Blondi"));
   WebAsyncTree tree = new WebAsyncTree(new DataProvider());
   WebSplitPane vert = new WebSplitPane(JSplitPane.VERTICAL_SPLIT, tabbedPane, textArea);
   WebSplitPane hor = new WebSplitPane(JSplitPane.HORIZONTAL_SPLIT, tree, vert);
   baseFrame.add(hor);
   baseFrame.setVisible(true);
   baseFrame.setState(baseFrame.MAXIMIZED_BOTH);
   baseFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 }
  private View(ViewControl control) {
    mControl = control;

    WebLookAndFeel.install();

    ToolTipManager.sharedInstance().setInitialDelay(200);

    mContactListView = new ContactListView(this, ContactList.getInstance());
    ContactList.getInstance().addObserver(mContactListView);
    mChatListView = new ChatListView(this, ChatList.getInstance());
    ChatList.getInstance().addObserver(mChatListView);

    // chat view
    mChatView = new ChatView(this);
    ChatList.getInstance().addObserver(mChatView);

    // content area
    mContent = new Content(this, mChatView);

    // search panel
    mSearchPanel = new SearchPanel(new Table[] {mContactListView, mChatListView}, mChatView);

    // status bar
    WebStatusBar statusBar = new WebStatusBar();
    mStatusBarLabel = new WebStatusLabel(" ");
    statusBar.add(mStatusBarLabel);

    // main frame
    mMainFrame =
        new MainFrame(this, mContactListView, mChatListView, mContent, mSearchPanel, statusBar);
    mMainFrame.setVisible(true);

    // tray
    mTrayManager = new TrayManager(this, mMainFrame);
    ChatList.getInstance().addObserver(mTrayManager);

    // hotkeys
    this.setHotkeys();

    // notifier
    mNotifier = new Notifier(this);

    this.statusChanged();
  }
  private static void setLookAndFeel() {
    /*for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    	System.out.println(info.getName());
    }*/

    /*
    try {
    	for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    		if ("Nimbus".equals(info.getName())) {
    			UIManager.setLookAndFeel(info.getClassName());

    			//UIManager.put("TextField.inactiveBackground", new Color(214,217,223));
    			//UIManager.put("FormattedTextField.inactiveBackground", new Color(214,217,223));
    			//UIManager.put("PasswordField.inactiveBackground", new Color(214,217,223));
    			//UIManager.put("TextField.disabledBackground", new Color(214,217,223));
    			//UIManager.put("textInactiveText", new Color(214,217,223));

    			break;
    		}
    	}
    } catch (Exception e) {
    	for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    		if ("Metal".equals(info.getName())) {
    			try {
    				UIManager.setLookAndFeel(info.getClassName());
    			} catch (Exception e1) {
    				e1.printStackTrace();
    			}
    			break;
    		}
    	}
    }
    */

    try {
      setUIFont();
      WebLookAndFeel.install();
      // UIManager.setLookAndFeel();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  public static JarStructure createJarStructure(final WebProgressDialog progress) {
    // Download listener in case of remote jar-file (for e.g. demo loaded from .jnlp)
    FileDownloadListener listener =
        new FileDownloadListener() {
          private int totalSize = 0;

          @Override
          public void sizeDetermined(int totalSize) {
            // Download started
            this.totalSize = totalSize;
            updateProgress(0);
          }

          @Override
          public void partDownloaded(int totalBytesDownloaded) {
            // Some part loaded
            updateProgress(totalBytesDownloaded);
          }

          @Override
          public boolean shouldStopDownload() {
            return false;
          }

          private void updateProgress(int downloaded) {
            // Updating progress text
            progress.setText(
                "<html>Loading source files... <b>"
                    + FileUtils.getFileSizeString(downloaded, 1)
                    + "</b> of <b>"
                    + FileUtils.getFileSizeString(totalSize, 1)
                    + "</b> done</html>");
          }

          @Override
          public void fileDownloaded(File file) {
            // Updating progress text
            progress.setText("Creating source files structure...");
          }

          @Override
          public void fileDownloadFailed(Throwable e) {
            // Updating progress text
            progress.setText("Filed to download source files");
          }
        };

    // Creating structure using any of classes contained inside jar
    progress.setText("Creating source files structure...");
    List<String> extensions = Arrays.asList(".java", ".png", ".gif", ".jpg", ".txt", ".xml");
    List<String> packages = Arrays.asList("com/alee", "licenses");
    JarStructure jarStructure =
        ReflectUtils.getJarStructure(ExamplesManager.class, extensions, packages, listener);

    // Updating some of package icons
    jarStructure.setPackageIcon(
        WebLookAndFeelDemo.class.getPackage(), new ImageIcon(WebLookAndFeel.getImages().get(0)));
    for (ExampleGroup exampleGroup : getExampleGroups()) {
      jarStructure.setClassIcon(exampleGroup.getClass(), (ImageIcon) exampleGroup.getGroupIcon());
    }

    return jarStructure;
  }