コード例 #1
0
 protected void _actionPerformed(ActionEvent e) {
   show = !show;
   if (show) {
     putValue(NAME, "Hide Views");
     Log.info("Views showing.");
   } else {
     putValue(NAME, "Show Views");
     Log.info("Views hidden.");
   }
   MainFrame.INSTANCE.showViews(show);
 }
コード例 #2
0
ファイル: Main.java プロジェクト: francisjerin/mb-pde
 static { // statische initialisierungen
   SimpleLogListener listener = new SimpleLogListener(System.out);
   Log.addLogListener(listener);
   if (System.getProperty("log2file") != null) {
     try {
       String lf = System.getProperty("user.home") + File.separatorChar + "jdraw.log";
       Log.addLogListener(new SimpleLogListener(new PrintStream(new FileOutputStream(lf))));
     } catch (FileNotFoundException e) {
       Log.exception(e);
     }
   }
 }
コード例 #3
0
ファイル: Main.java プロジェクト: francisjerin/mb-pde
 private static void setupUI(String[] args) {
   LookAndFeel lf = GUIUtil.findLF(args);
   try {
     UIManager.setLookAndFeel(lf);
     Object[] uiDefaults = {
       "FileChooserUI",
       FileBrowserUI.FILE_BROWSER_UI,
       "TitledBorder.font",
       new FontUIResource(MainFrame.DEFAULT_FONT)
     };
     UIManager.getDefaults().putDefaults(uiDefaults);
   } catch (Exception e) {
     Log.exception(e);
   }
 }
コード例 #4
0
ファイル: Main.java プロジェクト: francisjerin/mb-pde
  public static final void main(String[] args) {
    ResourceLoader.scalingHint = Image.SCALE_SMOOTH;
    setupUI(args);

    DrawDialog splash = new DrawDialog(null, APP_NAME + " Splash", true);
    splash.setModal(false);
    ImageIcon icon = ResourceLoader.getImage("jdomain/jdraw/images/logo.png");
    splash.getContentPane().add(new JLabel(icon));
    splash.open();

    preload();
    Picture picture = null;
    final int len = args.length;
    if (len > 0) {
      for (int i = 0; i < len; i++) {
        if (args[i] != null) {
          picture = LoadAction.readImage(args[i]);
          break;
        }
      }
    }
    if (picture == null) {
      picture = Picture.createDefaultPicture();
    }
    setPicture(picture);
    ResourceLoader.getImage("jdomain/jdraw/images/background.gif");

    Util.delay(SPLASH_DELAY);
    splash.close();
    ((DrawMenu) MainFrame.INSTANCE.getJMenuBar()).buildLastFilesMenu();
    DrawBrowser.INSTANCE.setOpenDir(Settings.INSTANCE.getOpenDir());
    DrawBrowser.INSTANCE.setSaveDir(Settings.INSTANCE.getSaveDir());
    ToolPanel.INSTANCE.getCurrentTool().activate();
    MainFrame.INSTANCE.setVisible(true);

    Log.info("Happy drawing!");
  }