Logo Search packages:      
Sourcecode: latexdraw version File versions  Download package

latexDraw::ui::LaTeXDrawFrame::LaTeXDrawFrame ( String[]  args,
boolean  splash 
) [inline]

The constructor by default.

Definition at line 389 of file LaTeXDrawFrame.java.

References addCommentsFrame, latexDraw::ui::components::ListJToggleButton::addComponent(), latexDraw::ui::components::ListJToggleButton::addSeparator(), latexDraw::ui::SplashScreen::addToProgressBar(), bordersPositionChoice, buttonBordersColor, buttonDbleBoundColor, buttonGradientEndC, buttonGradientStartC, buttonHatchColor, buttonInteriorColor, buttonShadowColor, checkNewVersion, codePanel, convertFrame, createToolbar(), currentFile, dbleBoundCheckBox, DEFAULT_CHECK_VERSION, DEFAULT_DISPLAY_BORDERS, DEFAULT_DISPLAY_CODEPANEL, DEFAULT_DISPLAY_XSCALE, DEFAULT_DISPLAY_YSCALE, dividerPosition, dotChoice, drawPanel, fileChooserExport, fileChooserSave, filledCheckBox, formerIsInAutoUpdate, latexDraw::ui::DrawContainer::getFigures(), getFileName(), latexDraw::ui::components::LToolbar::getSliderDelimitor(), hatchChoice, importPSTricksFile(), initializeGeneralFields(), latexDraw::ui::dialog::PreferencesFrame::isCodeInAutoUpdate(), latexDraw::ui::DrawPanel::isSelection(), joinButton, labelThickness, lineArrowLChoice, lineArrowRChoice, lineChoice, lookAndFeel, menuBar, mirrorButtons, onWindowClosing(), open(), pathExport, pathOpen, preferencesFrame, progressBar, projectName, rotationButtons, separateButton, latexDraw::ui::CodePanel::setIsInAutoUpdate(), latexDraw::ui::DrawPanel::setIsModified(), latexDraw::ui::dialog::BatchConvertFrame::setPathOutput(), latexDraw::ui::dialog::BatchConvertFrame::setPathSelect(), setSelection(), setStatusBarText(), setTitle(), latexDraw::ui::components::YScale::setXScale(), shadowCheckBox, splitPane, statusBar, stopButton, thicknessField, toolbar, undoManager, latexDraw::ui::components::LMenuBar::updateRecentFilesMenu(), updateSplitSeparatorPosition(), updateUndoRedo(), WITH_UPDATE, xScale, and yScale.

      {
            dividerPosition = 0.8;
            
            SplashScreen splashScreen = new SplashScreen(lookAndFeel);

            if(splash)
                  splashScreen.setVisible(true);
            
            try
            {
                  splashScreen.addToProgressBar(5);
                  statusBar = new JTextField("");//$NON-NLS-1$
                  statusBar.setEditable(false);
                  
                  progressBar = new JProgressBar();
                  progressBar.setMaximumSize(new Dimension(300, 20));
                  progressBar.setPreferredSize(new Dimension(300, 20));
                  progressBar.setVisible(false);
                  
                  menusListener = new MenusListener(this);
                  
                  splashScreen.addToProgressBar(15);
                  setIconImage(LaTeXDrawResources.latexdrawIcon.getImage());
                  
                  checkNewVersion = DEFAULT_CHECK_VERSION && WITH_UPDATE;
            codePanel  = new CodePanel(this);
            codePanel.setVisible(DEFAULT_DISPLAY_CODEPANEL);
            splashScreen.addToProgressBar(5);
            DrawContainer draw = new DrawContainer(DEFAULT_DISPLAY_BORDERS);
            splashScreen.addToProgressBar(10);
            drawPanel  = new DrawPanel(draw, codePanel, this);
            splashScreen.addToProgressBar(5);
            
              JPanel paramsToolbar = new JPanel(new FlowLayout(FlowLayout.LEFT));   
            JPanel p= new JPanel();
            
                  projectName       = null;
                  fileChooserSave   = null;
                  fileChooserExport = null;
                  currentFile       = null;           
                  
                  splashScreen.addToProgressBar(5);
                  menuBar = new LMenuBar(this);
                  splashScreen.addToProgressBar(10);
                  createToolbar();
                  splashScreen.addToProgressBar(10);
                  
            undoManager = new UndoRedoManager(draw.getFigures(), draw, this);
            splashScreen.addToProgressBar(5);
      
            yScale = new YScale(drawPanel, xScale);
            yScale.setVisible(DEFAULT_DISPLAY_YSCALE);
            xScale = new XScale(drawPanel, yScale);
            yScale.setXScale(xScale);
            xScale.setVisible(DEFAULT_DISPLAY_XSCALE);
            
            p.setLayout(new BorderLayout());
            p.add(yScale, BorderLayout.WEST);
            p.add(xScale, BorderLayout.NORTH);
            p.add(drawPanel, BorderLayout.CENTER);
              setJMenuBar(menuBar);
              updateUndoRedo();
              splashScreen.addToProgressBar(10);
      
            splitPane =  new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, p, codePanel);
            splitPane.setContinuousLayout(true); 
            splitPane.setOneTouchExpandable(true); 
            splitPane.setDividerSize(6);
            
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(toolbar, BorderLayout.NORTH);
            getContentPane().add(splitPane, BorderLayout.CENTER);
            
                  addCommentsFrame = new AddCommentsFrame(this);
                  
            SpinnerModel model = new SpinnerNumberModel(Figure.DEFAULT_THICKNESS,0.1,1000,0.1);
            thicknessField = new JSpinner(model);
            thicknessField.setEditor(new JSpinner.NumberEditor(thicknessField, "0.0"));//$NON-NLS-1$
                  thicknessField.addChangeListener(this);
            thicknessField.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.65")); //$NON-NLS-1$
            thicknessField.setName(LaTeXDrawResources.NAME_THICKNESS_FIELD);
            thicknessField.setMaximumSize(new Dimension(55, 30));
            thicknessField.setMinimumSize(new Dimension(55, 30));
            thicknessField.setPreferredSize(new Dimension(55, 30));
            
            model = new SpinnerNumberModel(Dot.DEFAULT_WIDTH,0.1,1000,0.1);
            dotSizeField = new JSpinner(model);
            dotSizeField.setEditor(new JSpinner.NumberEditor(dotSizeField, "0.0"));//$NON-NLS-1$
            dotSizeField.addChangeListener(this);
            dotSizeField.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.0")); //$NON-NLS-1$
            dotSizeField.setName(LaTeXDrawResources.NAME_DOT_SIZE_FIELD);
            dotSizeField.setMaximumSize(new Dimension(55, 30));
            dotSizeField.setMinimumSize(new Dimension(55, 30));
            dotSizeField.setPreferredSize(new Dimension(55, 30));
            labelDotSize = new JLabel(LaTeXDrawResources.dotStyleNoneIcon);
            
            buttonBordersColor = new ColorButton(LaTeXDrawResources.LABEL_COLOR_BUTTON, new ButtonIcon(Color.BLACK));
            buttonBordersColor.setMargin(INSET_BUTTON);
            buttonBordersColor.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.66")); //$NON-NLS-1$
            buttonBordersColor.setActionCommand(LaTeXDrawResources.LABEL_COLOR_BUTTON);
            buttonBordersColor.addActionListener(this);
            genLineCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_BUTTON, new ButtonIcon(Color.BLACK));
            genLineCB.setMargin(INSET_BUTTON);
            genLineCB.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.66")); //$NON-NLS-1$
            genLineCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_BUTTON);
            genLineCB.addActionListener(this);
            
            filledCheckBox = new JCheckBox(LaTeXDrawResources.LABEL_FILLED_CHECKBOX);
            filledCheckBox.setMargin(LaTeXDrawFrame.INSET_BUTTON);
            filledCheckBox.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.67")); //$NON-NLS-1$
            filledCheckBox.setActionCommand(LaTeXDrawResources.LABEL_FILLED_CHECKBOX);
            filledCheckBox.addActionListener(this);
            
            buttonInteriorColor = new ColorButton(LaTeXDrawResources.LABEL_COLOR_INTERIOR_BUTTON, new ButtonIcon(Figure.DEFAULT_INTERIOR_COL));
            buttonInteriorColor.setMargin(INSET_BUTTON);
            buttonInteriorColor.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.68")); //$NON-NLS-1$
            buttonInteriorColor.setActionCommand(LaTeXDrawResources.LABEL_COLOR_INTERIOR_BUTTON);
            buttonInteriorColor.addActionListener(this);
            genInteriorCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_INTERIOR_BUTTON, new ButtonIcon(Figure.DEFAULT_INTERIOR_COL));
            genInteriorCB.setMargin(INSET_BUTTON);
            genInteriorCB.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.68")); //$NON-NLS-1$
            genInteriorCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_INTERIOR_BUTTON);
            genInteriorCB.addActionListener(this);
            
            buttonHatchColor = new ColorButton(LaTeXDrawResources.LABEL_COLOR_HATCH, new ButtonIcon(Figure.DEFAULT_BORDERS_COL));
            buttonHatchColor.setMargin(INSET_BUTTON);
            buttonHatchColor.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.69")); //$NON-NLS-1$
            buttonHatchColor.setActionCommand(LaTeXDrawResources.LABEL_COLOR_HATCH);
            buttonHatchColor.addActionListener(this);
            genHatchCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_HATCH, new ButtonIcon(Figure.DEFAULT_BORDERS_COL));
            genHatchCB.setMargin(INSET_BUTTON);
            genHatchCB.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.69")); //$NON-NLS-1$
            genHatchCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_HATCH);
            genHatchCB.addActionListener(this);
            
            dotChoice = Dot.createDotStyleChoice();
            dotChoice.setName(LaTeXDrawResources.CHOICE_DOT_NAME);
            dotChoice.addItemListener(this);
            dotChoice.setPreferredSize(new Dimension(55,30));
            dotChoice.setMaximumSize(new Dimension(55,30));
            
            lineChoice = Figure.createStyleLineChoice();
            lineChoice.setName(LaTeXDrawResources.CHOICE_LINE_NAME);
            lineChoice.addItemListener(this);
            lineChoice.setPreferredSize(new Dimension(70,30));
            lineChoice.setMaximumSize(new Dimension(70,30));
            
            hatchChoice = Figure.createFillChoice();
            hatchChoice.addItemListener(this);
            hatchChoice.setPreferredSize(new Dimension(65,30));
            hatchChoice.setMaximumSize(new Dimension(65,30));
            
            lineArrowLChoice = ArrowHead.createLeftArrowStyleList();
            lineArrowLChoice.setName(LaTeXDrawResources.CHOICE_ARROW_LEFT_NAME);
            lineArrowLChoice.addItemListener(this);
            lineArrowLChoice.setPreferredSize(new Dimension(80,30));
            lineArrowLChoice.setMaximumSize(new Dimension(80,30));
            
            lineArrowRChoice = ArrowHead.createRightArrowStyleList();
            lineArrowRChoice.setName(LaTeXDrawResources.CHOICE_ARROW_RIGHT_NAME);
            lineArrowRChoice.addItemListener(this); 
            lineArrowRChoice.setPreferredSize(new Dimension(80,30));
            lineArrowRChoice.setMaximumSize(new Dimension(80,30));
              splashScreen.addToProgressBar(5);
              JButton buttonImageForeground = new JButton(LaTeXDrawResources.foregroundIcon);
              buttonImageForeground.setMargin(INSET_BUTTON);
              buttonImageForeground.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.70")); //$NON-NLS-1$
              buttonImageForeground.addActionListener(this);
              buttonImageForeground.setActionCommand(LaTeXDrawResources.LABEL_FOREGROUND);
              
              JButton buttonImageBackground = new JButton(LaTeXDrawResources.backgroundIcon);
              buttonImageBackground.setMargin(INSET_BUTTON);
              buttonImageBackground.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.71")); //$NON-NLS-1$
              buttonImageBackground.addActionListener(this);
              buttonImageBackground.setActionCommand(LaTeXDrawResources.LABEL_BACKGROUND);
            
              JButton buttonImageFront = new JButton(LaTeXDrawResources.inFrontOfSelIcon);
              buttonImageFront.setMargin(INSET_BUTTON);
            buttonImageFront.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.72")); //$NON-NLS-1$
            buttonImageFront.addActionListener(this);
            buttonImageFront.setActionCommand(LaTeXDrawResources.LABEL_FRONT_SEL);

            JButton buttonImageBehind = new JButton(LaTeXDrawResources.behindSelIcon);
            buttonImageBehind.setMargin(INSET_BUTTON);
              buttonImageBehind.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.73")); //$NON-NLS-1$
              buttonImageBehind.addActionListener(this);
              buttonImageBehind.setActionCommand(LaTeXDrawResources.LABEL_BEHIND_SEL);
            
              rotationButtons = new ListJToggleButton(this, LaTeXDrawResources.rotateIcon, ListJToggleButton.LOCATION_NORTH);
              rotationButtons.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.2")); //$NON-NLS-1$
              
              rotateButton = new JToggleButton(LaTeXDrawResources.rotateIcon);
            rotateButton.setMargin(INSET_BUTTON);
            rotateButton.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.74")); //$NON-NLS-1$
            rotateButton.addActionListener(this);
            rotateButton.setActionCommand(LaTeXDrawResources.LABEL_ROTATE);
            
            JButton rotate90Button = new JButton(LaTeXDrawResources.rotate90Icon);
            rotate90Button.setMargin(INSET_BUTTON);
            rotate90Button.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.3")); //$NON-NLS-1$
            rotate90Button.addActionListener(this);
            rotate90Button.setActionCommand(LaTeXDrawResources.LABEL_ROTATE_90);
            
            JButton rotate180Button = new JButton(LaTeXDrawResources.rotate180Icon);
            rotate180Button.setMargin(INSET_BUTTON);
            rotate180Button.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.4")); //$NON-NLS-1$
            rotate180Button.addActionListener(this);
            rotate180Button.setActionCommand(LaTeXDrawResources.LABEL_ROTATE_180);
            
            JButton rotate270Button = new JButton(LaTeXDrawResources.rotate270Icon);
            rotate270Button.setMargin(INSET_BUTTON);
            rotate270Button.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.5")); //$NON-NLS-1$
            rotate270Button.addActionListener(this);
            rotate270Button.setActionCommand(LaTeXDrawResources.LABEL_ROTATE_270);
            
            rotationButtons.addComponent(rotateButton);
            rotationButtons.addComponent(rotate90Button);
            rotationButtons.addComponent(rotate180Button);
            rotationButtons.addComponent(rotate270Button);
            rotationButtons.addSeparator();
            
            mirrorButtons = new ListJToggleButton(this, LaTeXDrawResources.mirrorHIcon, ListJToggleButton.LOCATION_NORTH);
            mirrorButtons.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.6")); //$NON-NLS-1$
            
            JButton button = new JButton(LaTeXDrawResources.mirrorHIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.7")); //$NON-NLS-1$
            button.addActionListener(this);
            button.setActionCommand(LaTeXDrawResources.LABEL_MIRROR_H);
            mirrorButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.mirrorVIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getString1_8("LaTeXDrawFrame.8")); //$NON-NLS-1$
            button.addActionListener(this);
            button.setActionCommand(LaTeXDrawResources.LABEL_MIRROR_V);
              splashScreen.addToProgressBar(5);
            mirrorButtons.addComponent(button);
            mirrorButtons.addSeparator();
            
            alignButtons = new ListJToggleButton(this, LaTeXDrawResources.alignLeftIcon, ListJToggleButton.LOCATION_NORTH);
            alignButtons.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.1")); //$NON-NLS-1$
            ToolbarListener tl = new ToolbarListener(this);
            
            button = new JButton(LaTeXDrawResources.alignLeftIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.2")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_LEFT);
            alignButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.alignRightIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.3")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_RIGHT);
            alignButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.alignTopIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.4")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_TOP);
            alignButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.alignBottomIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.5")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_BOTTOM);
            alignButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.alignMiddleHorizIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.6")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_MIDDLE_H);
            alignButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.alignMiddleVertIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.7")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_ALIGN_MIDDLE_V);
            alignButtons.addComponent(button);
            alignButtons.addSeparator();
            
            distribButtons = new ListJToggleButton(this, LaTeXDrawResources.distVertBottomIcon, ListJToggleButton.LOCATION_NORTH);
            distribButtons.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.8")); //$NON-NLS-1$
            
            button = new JButton(LaTeXDrawResources.distVertBottomIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.9")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_V_BOTTOM);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distVertEqualIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.10")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_V_EQ);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distVertMiddleIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.11")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_V_MID);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distVertTopIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.12")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_V_TOP);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distHorizLeftIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.13")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_H_LEFT);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distHorizEqualIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.14")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_H_EQ);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distHorizMiddleIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.15")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_H_MID);
            distribButtons.addComponent(button);
            
            button = new JButton(LaTeXDrawResources.distHorizRightIcon);
            button.setMargin(INSET_BUTTON);
            button.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.16")); //$NON-NLS-1$
            button.addActionListener(tl);
            button.setActionCommand(ToolbarListener.LABEL_DISTRIB_H_RIGHT);
            distribButtons.addComponent(button);
            
            joinButton = new JButton(LaTeXDrawResources.joinIcon);
            joinButton.setMargin(INSET_BUTTON);
            joinButton.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.75")); //$NON-NLS-1$
            joinButton.addActionListener(this);
            joinButton.setActionCommand(LaTeXDrawResources.LABEL_JOIN);
              
              separateButton = new JButton(LaTeXDrawResources.separateIcon);
              separateButton.setMargin(INSET_BUTTON);
              separateButton.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.76")); //$NON-NLS-1$
              separateButton.addActionListener(this);
              separateButton.setActionCommand(LaTeXDrawResources.LABEL_SEPARATE);
            
              bordersPositionChoice = Figure.createBordersPositionChoice();
              bordersPositionChoice.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.77")); //$NON-NLS-1$
              bordersPositionChoice.addItemListener(this);
              bordersPositionChoice.setPreferredSize(new Dimension(45,30));
              bordersPositionChoice.setMaximumSize(new Dimension(45,30));
              
              dbleBoundCheckBox = new JCheckBox(LaTeXDrawResources.LABEL_DBLE_BOUND_CHECKBOX);
              dbleBoundCheckBox.setMargin(INSET_BUTTON);
              dbleBoundCheckBox.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.78")); //$NON-NLS-1$
              dbleBoundCheckBox.setActionCommand(LaTeXDrawResources.LABEL_DBLE_BOUND_CHECKBOX);
              dbleBoundCheckBox.addActionListener(this);
            
              buttonDbleBoundColor = new ColorButton(LaTeXDrawResources.LABEL_DBLE_BOUND_CHECKBOX, new ButtonIcon(Figure.DEFAULT_DOUBLE_COLOR));
              buttonDbleBoundColor.setMargin(INSET_BUTTON);
              buttonDbleBoundColor.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.79")); //$NON-NLS-1$
              buttonDbleBoundColor.setActionCommand(LaTeXDrawResources.LABEL_COLOR_DBLE_BOUND);
              buttonDbleBoundColor.addActionListener(this);
              genDbleBordCB = new ColorButton(LaTeXDrawResources.LABEL_DBLE_BOUND_CHECKBOX, new ButtonIcon(Figure.DEFAULT_DOUBLE_COLOR));
              genDbleBordCB.setMargin(INSET_BUTTON);
              genDbleBordCB.setToolTipText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.79")); //$NON-NLS-1$
              genDbleBordCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_DBLE_BOUND);
              genDbleBordCB.addActionListener(this);

              stopButton = new JButton(LaTeXDrawResources.stopIcon);
              stopButton.setMargin(INSET_BUTTON);
              stopButton.setActionCommand(LaTeXDrawResources.LABEL_STOP);
              stopButton.addActionListener(this);
              stopButton.setName(LaTeXDrawResources.LABEL_STOP);
              stopButton.setToolTipText(LaTeXDrawLang.getString1_6("LaTeXDrawFrame.9")); //$NON-NLS-1$
              stopButton.setVisible(false);
              
              shadowCheckBox = new JCheckBox(LaTeXDrawResources.LABEL_SHADOW_CHECKBOX);
              shadowCheckBox.setMargin(INSET_BUTTON);
              shadowCheckBox.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.4")); //$NON-NLS-1$
              shadowCheckBox.setActionCommand(LaTeXDrawResources.LABEL_SHADOW_CHECKBOX);
              shadowCheckBox.addActionListener(this); 
              
              buttonShadowColor = new ColorButton(LaTeXDrawResources.LABEL_COLOR_SHADOW, new ButtonIcon(Figure.DEFAULT_SHADOW_COLOR));
              buttonShadowColor.setMargin(INSET_BUTTON);
              buttonShadowColor.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.5")); //$NON-NLS-1$
              buttonShadowColor.setActionCommand(LaTeXDrawResources.NAME_COLOR_SHADOW);
              buttonShadowColor.addActionListener(this);
              genShadowCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_SHADOW, new ButtonIcon(Figure.DEFAULT_SHADOW_COLOR));
              genShadowCB.setMargin(INSET_BUTTON);
              genShadowCB.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.5")); //$NON-NLS-1$
              genShadowCB.setActionCommand(LaTeXDrawResources.NAME_COLOR_SHADOW);
              genShadowCB.addActionListener(this);
              
            labelThickness = new JLabel(LaTeXDrawResources.thicknessIcon); 
            locationButtons = new ListJToggleButton(this, LaTeXDrawResources.foregroundIcon, ListJToggleButton.LOCATION_NORTH);
            locationButtons.addComponent(buttonImageForeground);
            locationButtons.addComponent(buttonImageBackground);
            locationButtons.addComponent(buttonImageFront);
            locationButtons.addComponent(buttonImageBehind);
            locationButtons.addSeparator();
            locationButtons.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.6")); //$NON-NLS-1$
            
              buttonGradientStartC = new ColorButton(LaTeXDrawResources.LABEL_COLOR_GRADIENT_FIRST, new ButtonIcon(PSTricksConstants.DEFAULT_GRADIENT_START_COLOR)); 
              buttonGradientStartC.setMargin(INSET_BUTTON);
              buttonGradientStartC.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.7")); //$NON-NLS-1$
              buttonGradientStartC.setActionCommand(LaTeXDrawResources.LABEL_COLOR_GRADIENT_FIRST);
              buttonGradientStartC.addActionListener(this);
              genGradientStartCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_GRADIENT_FIRST, new ButtonIcon(PSTricksConstants.DEFAULT_GRADIENT_START_COLOR)); 
              genGradientStartCB.setMargin(INSET_BUTTON);
              genGradientStartCB.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.7")); //$NON-NLS-1$
              genGradientStartCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_GRADIENT_FIRST);
              genGradientStartCB.addActionListener(this);
              
              buttonGradientEndC = new ColorButton(LaTeXDrawResources.LABEL_COLOR_GRADIENT_SECOND, new ButtonIcon(PSTricksConstants.DEFAULT_GRADIENT_END_COLOR));
              buttonGradientEndC.setMargin(INSET_BUTTON);
              buttonGradientEndC.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.8")); //$NON-NLS-1$
              buttonGradientEndC.setActionCommand(LaTeXDrawResources.LABEL_COLOR_GRADIENT_SECOND);
              buttonGradientEndC.addActionListener(this);
              genGradientEndCB = new ColorButton(LaTeXDrawResources.LABEL_COLOR_GRADIENT_SECOND, new ButtonIcon(PSTricksConstants.DEFAULT_GRADIENT_END_COLOR));
              genGradientEndCB.setMargin(INSET_BUTTON);
              genGradientEndCB.setToolTipText(LaTeXDrawLang.getString1_7("LaTeXDrawFrame.8")); //$NON-NLS-1$
              genGradientEndCB.setActionCommand(LaTeXDrawResources.LABEL_COLOR_GRADIENT_SECOND);
              genGradientEndCB.addActionListener(this);
              splashScreen.addToProgressBar(5);
              
                  initializeGeneralFields();
                  genColorL = new ListJToggleButton(this, LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.17"), ListJToggleButton.LOCATION_NORTH); //$NON-NLS-1$
                  genColorL.addComponent(genLineCB);
                  genColorL.addComponent(genInteriorCB);
                  genColorL.addComponent(genHatchCB);
                  genColorL.addComponent(genDbleBordCB);
                  genColorL.addComponent(genShadowCB);
                  genColorL.addComponent(genGradientStartCB);
                  genColorL.addComponent(genGradientEndCB);
                  
            paramsToolbar.add(progressBar);
            paramsToolbar.add(stopButton);
            paramsToolbar.add(rotationButtons);
            paramsToolbar.add(locationButtons);
            paramsToolbar.add(mirrorButtons);
            paramsToolbar.add(alignButtons);
            paramsToolbar.add(distribButtons);
            paramsToolbar.add(joinButton);
            paramsToolbar.add(separateButton);
              paramsToolbar.add(labelThickness);
            paramsToolbar.add(thicknessField);
            paramsToolbar.add(labelDotSize);
            paramsToolbar.add(dotSizeField);
            paramsToolbar.add(genColorL);
            paramsToolbar.add(buttonBordersColor);
            paramsToolbar.add(filledCheckBox);
            paramsToolbar.add(buttonInteriorColor);
            paramsToolbar.add(hatchChoice);
            paramsToolbar.add(buttonGradientStartC);
            paramsToolbar.add(buttonGradientEndC);
            paramsToolbar.add(buttonHatchColor);
            paramsToolbar.add(dotChoice);
            paramsToolbar.add(lineChoice);
            paramsToolbar.add(lineArrowLChoice);
            paramsToolbar.add(lineArrowRChoice);
            paramsToolbar.add(bordersPositionChoice);
            paramsToolbar.add(dbleBoundCheckBox);
            paramsToolbar.add(buttonDbleBoundColor);
            paramsToolbar.add(shadowCheckBox);
            paramsToolbar.add(buttonShadowColor);
            
            JPanel southPanel = new JPanel();
            southPanel.setLayout(new BorderLayout());
            southPanel.add(paramsToolbar, BorderLayout.CENTER);  
            southPanel.add(statusBar, BorderLayout.SOUTH);
            getContentPane().add(southPanel, BorderLayout.SOUTH);
              splashScreen.addToProgressBar(5);
            preferencesFrame = new PreferencesFrame(draw, this);
            formerIsInAutoUpdate = preferencesFrame.isCodeInAutoUpdate();
            convertFrame.setPathSelect(pathOpen);
            convertFrame.setPathOutput(pathExport);
            codePanel.setIsInAutoUpdate(formerIsInAutoUpdate);
                  recentFilesListener = new RecentFilesListener(preferencesFrame, this);
                  shortcutsListener = new ShortcutsListener(this);
                  addKeyListener(shortcutsListener);

            drawPanel.isSelection(false);
            setTitle(LaTeXDrawResources.LABEL_APP);
            setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
            
            addWindowListener(
                      new WindowAdapter() 
                      {
                                    @Override
                                    public void windowClosing(WindowEvent e) 
                          {
                              onWindowClosing();
                          }
                      });  
            
            setCurrentChoice(LaTeXDrawResources.LABEL_SELECT_FIGURE);
            setSelection(false);
            
            boolean fileIsOk = true;
            /* Management of command line */
            String fName = getFileName(args);
            
            if(args.length>1)
                  setStatusBarText(LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.81")); //$NON-NLS-1$
            
            if(fName!=null)
                  if(fName.toLowerCase().endsWith(TeXFilter.TEX_EXTENSION))
                        fileIsOk = importPSTricksFile(fName);
                  else 
                        fileIsOk = open(fName, false);
            
            menuBar.updateRecentFilesMenu();
            drawPanel.setIsModified(false);
              splashScreen.addToProgressBar(5);
              
            if(checkNewVersion && WITH_UPDATE)
            {
                  VersionChecker vc = new VersionChecker(this);
                  vc.start();
            }
            
                  addWindowStateListener(this);
            splashScreen.setVisible(false);     
                  setVisible(true);
                  updateSplitSeparatorPosition();
                  toolbar.getSliderDelimitor().setValue(Delimitor.getOpacity());
            
                  if(!fileIsOk)
                        JOptionPane.showMessageDialog(this, LaTeXDrawLang.getStringLaTeXDrawFrame("LFrame2.18"), //$NON-NLS-1$
                                  LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.86"), JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$
            }
            catch(Exception e1) 
            {
                  splashScreen.setVisible(false);
                  JOptionPane.showMessageDialog(this, LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.82") + //$NON-NLS-1$
                            e1.toString(), LaTeXDrawLang.getStringLaTeXDrawFrame("LaTeXDrawFrame.83"),  //$NON-NLS-1$
                            JOptionPane.WARNING_MESSAGE); 
                  e1.printStackTrace(); 
                  LaTeXDrawFrame.this.windowClosed();
            }
      }


Generated by  Doxygen 1.6.0   Back to index