Search in sources :

Example 1 with java.awt.event

use of java.awt.event in project intellij-community by JetBrains.

the class BalloonImpl method createComponent.

private void createComponent() {
    myComp = new MyComponent(myContent, this, myShadowBorderProvider != null ? null : myShowPointer ? myPosition.createBorder(this) : getPointlessBorder());
    if (myActionProvider == null) {
        final Consumer<MouseEvent> listener = event -> {
            SwingUtilities.invokeLater(() -> hide());
        };
        myActionProvider = new ActionProvider() {

            private ActionButton myCloseButton;

            @NotNull
            @Override
            public List<ActionButton> createActions() {
                myCloseButton = new CloseButton(listener);
                return Collections.singletonList(myCloseButton);
            }

            @Override
            public void layout(@NotNull Rectangle lpBounds) {
                if (!myCloseButton.isVisible()) {
                    return;
                }
                Icon icon = getCloseButton();
                int iconWidth = icon.getIconWidth();
                int iconHeight = icon.getIconHeight();
                Rectangle r = new Rectangle(lpBounds.x + lpBounds.width - iconWidth + (int) (iconWidth * 0.3), lpBounds.y - (int) (iconHeight * 0.3), iconWidth, iconHeight);
                Insets border = getShadowBorderInsets();
                r.x -= border.left;
                r.y -= border.top;
                myCloseButton.setBounds(r);
            }
        };
    }
    myComp.clear();
    myComp.myAlpha = isAnimationEnabled() ? 0f : -1;
    myComp.setBorder(new EmptyBorder(getShadowBorderInsets()));
    myLayeredPane.add(myComp);
    // the second balloon must be over the first one
    myLayeredPane.setLayer(myComp, getLayer(), 0);
    myPosition.updateBounds(this);
    if (myBlockClicks) {
        myComp.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                e.consume();
            }

            @Override
            public void mousePressed(MouseEvent e) {
                e.consume();
            }

            @Override
            public void mouseReleased(MouseEvent e) {
                e.consume();
            }
        });
    }
}
Also used : com.intellij.openapi.util(com.intellij.openapi.util) AccessibleContextUtil(com.intellij.util.ui.accessibility.AccessibleContextUtil) Wrapper(com.intellij.ui.components.panels.Wrapper) AllIcons(com.intellij.icons.AllIcons) HyperlinkEvent(javax.swing.event.HyperlinkEvent) Area(java.awt.geom.Area) Rectangle2D(java.awt.geom.Rectangle2D) HashSet(com.intellij.util.containers.HashSet) FocusRequestor(com.intellij.openapi.wm.FocusRequestor) ShadowBorderPainter(com.intellij.openapi.ui.impl.ShadowBorderPainter) Balloon(com.intellij.openapi.ui.popup.Balloon) RGBImageFilter(java.awt.image.RGBImageFilter) LightweightWindowEvent(com.intellij.openapi.ui.popup.LightweightWindowEvent) IdeGlassPaneUtil(com.intellij.openapi.wm.IdeGlassPaneUtil) NonOpaquePanel(com.intellij.ui.components.panels.NonOpaquePanel) BufferedImage(java.awt.image.BufferedImage) com.intellij.ide(com.intellij.ide) Set(java.util.Set) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) RoundRectangle2D(java.awt.geom.RoundRectangle2D) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) IdeFocusManager(com.intellij.openapi.wm.IdeFocusManager) com.intellij.util.ui(com.intellij.util.ui) java.awt.event(java.awt.event) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) ApplicationManager(com.intellij.openapi.application.ApplicationManager) EmptyBorder(javax.swing.border.EmptyBorder) Registry(com.intellij.openapi.util.registry.Registry) GeneralPath(java.awt.geom.GeneralPath) NotNull(org.jetbrains.annotations.NotNull) RelativePoint(com.intellij.ui.awt.RelativePoint) ImageFilter(java.awt.image.ImageFilter) Consumer(com.intellij.util.Consumer) DataContext(com.intellij.openapi.actionSystem.DataContext) GraphicsConfig(com.intellij.openapi.ui.GraphicsConfig) ScreenReader(com.intellij.util.ui.accessibility.ScreenReader) ActionManager(com.intellij.openapi.actionSystem.ActionManager) AnActionListener(com.intellij.openapi.actionSystem.ex.AnActionListener) JdkConstants(org.intellij.lang.annotations.JdkConstants) JBPopupListener(com.intellij.openapi.ui.popup.JBPopupListener) AnAction(com.intellij.openapi.actionSystem.AnAction) java.awt(java.awt) MnemonicHelper(com.intellij.openapi.MnemonicHelper) ObjectUtils(com.intellij.util.ObjectUtils) IdeGlassPaneEx(com.intellij.openapi.wm.impl.IdeGlassPaneEx) Collections(java.util.Collections) Alarm(com.intellij.util.Alarm) javax.swing(javax.swing) NotNull(org.jetbrains.annotations.NotNull) List(java.util.List) EmptyBorder(javax.swing.border.EmptyBorder)

Example 2 with java.awt.event

use of java.awt.event in project grafikon by jub77.

the class OutputTemplateDialog method initComponents.

private void initComponents() {
    javax.swing.JPanel controlPanel = new javax.swing.JPanel();
    javax.swing.JPanel buttonPanel = new javax.swing.JPanel();
    ((FlowLayout) buttonPanel.getLayout()).setAlignment(FlowLayout.RIGHT);
    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
    controlPanel.setLayout(new java.awt.BorderLayout());
    // NOI18N
    okButton.setText(ResourceLoader.getString("button.ok"));
    okButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(evt);
        }
    });
    buttonPanel.add(okButton);
    // NOI18N
    cancelButton.setText(ResourceLoader.getString("button.cancel"));
    cancelButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelButtonActionPerformed(evt);
        }
    });
    buttonPanel.add(cancelButton);
    controlPanel.add(buttonPanel, BorderLayout.EAST);
    getContentPane().add(controlPanel, java.awt.BorderLayout.SOUTH);
    JPanel leftPanel = new JPanel();
    controlPanel.add(leftPanel, BorderLayout.WEST);
    // NOI18N
    JButton importTextsButton = new JButton(ResourceLoader.getString("ot.button.import.texts"));
    importTextsButton.addActionListener(event -> {
        importTextFromTemplate();
    });
    leftPanel.add(importTextsButton);
    // NOI18N
    JButton attachmentsButton = new JButton(ResourceLoader.getString("ot.button.attachments"));
    leftPanel.add(attachmentsButton);
    attachmentsButton.addActionListener(evt -> {
        EditAttachmentsDialog dialog = EditAttachmentsDialog.newInstance(GuiComponentUtils.getWindow(this), true, attachmentChooser);
        dialog.setLocationRelativeTo(this);
        dialog.showDialog(template);
    });
    // NOI18N
    JButton writeTemplateOutputButton = new JButton(ResourceLoader.getString("ot.button.output"));
    leftPanel.add(writeTemplateOutputButton);
    writeTemplateOutputButton.setEnabled(this.templateWriter != null);
    writeTemplateOutputButton.addActionListener(evt -> {
        OutputTemplate tempTemplate = this.createTempOutputTemplate();
        if (tempTemplate != null) {
            templateWriter.accept(tempTemplate);
        }
    });
    tabbedPane = new javax.swing.JTabbedPane(javax.swing.JTabbedPane.TOP);
    tabbedPane.addChangeListener(e -> {
        if (scriptEditBox != null) {
            scriptEditBox.closeSearchDialog();
        }
        if (textTemplateEditBox != null) {
            textTemplateEditBox.closeSearchDialog();
        }
    });
    getContentPane().add(tabbedPane, BorderLayout.CENTER);
    javax.swing.JPanel templatePanel = new javax.swing.JPanel();
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("ot.tab.template"), null, templatePanel, null);
    templatePanel.setLayout(new BorderLayout(0, 0));
    textTemplateEditBox = new net.parostroj.timetable.gui.components.TextTemplateEditBox2();
    templatePanel.add(textTemplateEditBox);
    // NOI18N
    textTemplateEditBox.setTemplateFont(new java.awt.Font("Monospaced", 0, 12));
    textTemplateEditBox.setColumns(80);
    textTemplateEditBox.setRows(25);
    textTemplateEditBox.setVisibleTemplateLanguageChange(false);
    javax.swing.JPanel verifyPanel = new javax.swing.JPanel();
    templatePanel.add(verifyPanel, BorderLayout.SOUTH);
    FlowLayout flowLayout1 = (FlowLayout) verifyPanel.getLayout();
    flowLayout1.setAlignment(FlowLayout.LEFT);
    keyTextField = new javax.swing.JTextField(15);
    outputComboBox = new javax.swing.JComboBox<>();
    outputComboBox.setPrototypeDisplayValue("MMMMMM");
    outputTypeComboBox = new javax.swing.JComboBox<>();
    outputTypeComboBox.setPrototypeDisplayValue("MMMMMMMMMMM");
    outputComboBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                String output = (String) e.getItem();
                if (template != null) {
                    template.setAttribute(OutputTemplate.ATTR_OUTPUT, output);
                }
                outputTypeComboBox.removeAllItems();
                for (String type : OutputFactory.newInstance(output).getOutputTypes()) {
                    outputTypeComboBox.addItem(type);
                }
                if (template != null) {
                    if (OUTPUTS_WITH_TEMPLATE.contains(output)) {
                        updateValues(false);
                    } else {
                        updateValues(true);
                    }
                }
            }
        }
    });
    verifyPanel.add(keyTextField);
    verifyPanel.add(outputComboBox);
    verifyPanel.add(outputTypeComboBox);
    verifyButton = new javax.swing.JButton();
    // NOI18N
    verifyButton.setText(ResourceLoader.getString("ot.button.verify"));
    verifyButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            verifyButtonActionPerformed(evt);
        }
    });
    verifyPanel.add(verifyButton);
    javax.swing.JLabel suffixLabel = new javax.swing.JLabel(ResourceLoader.getString("ot.extension") + ":");
    verifyPanel.add(suffixLabel);
    extensionTextField = new javax.swing.JTextField();
    verifyPanel.add(extensionTextField);
    extensionTextField.setColumns(10);
    selectionTypeComboBox = new JComboBox<>();
    ModelObjectTypeWrapperDelegate motwd = new ModelObjectTypeWrapperDelegate();
    selectionTypeComboBox.addItem(Wrapper.getWrapper(null, motwd));
    for (ModelObjectType type : ModelObjectType.values()) {
        selectionTypeComboBox.addItem(Wrapper.getWrapper(type, motwd));
    }
    JLabel selectionLabel = new JLabel(ResourceLoader.getString("ot.selection.type") + ":");
    verifyPanel.add(selectionLabel);
    verifyPanel.add(selectionTypeComboBox);
    javax.swing.JPanel scriptPanel = new javax.swing.JPanel();
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("ot.tab.script"), null, scriptPanel, null);
    scriptPanel.setLayout(new BorderLayout(0, 0));
    scriptEditBox = new ScriptEditBox();
    scriptPanel.add(scriptEditBox);
    scriptEditBox.setScriptFont(new Font("Monospaced", Font.PLAIN, 12));
    scriptEditBox.setRows(15);
    scriptEditBox.setColumns(60);
    EditLocalizedStringListAddRemovePanel<AttributeReference<LocalizedString>> localizePanel = new EditLocalizedStringListAddRemovePanel<>(5, false);
    localizePanel.setModelProvider(i18nProvider);
    localizePanel.setPath(new Path("this"));
    localizePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("ot.tab.localization"), null, localizePanel, null);
    setupPanel = new AttributesPanel();
    setupPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    tabbedPane.addTab(ResourceLoader.getString("ot.tab.setup"), null, setupPanel, null);
    JPanel namePanel = new JPanel();
    namePanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    namePanel.setLayout(new BorderLayout(0, 0));
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("ot.name"), null, namePanel, null);
    EditLocalizedStringPanel nameEditPanel = new EditLocalizedStringPanel(5);
    nameEditPanel.setModelProvider(nameProvider);
    nameEditPanel.setPath(new Path("this"));
    namePanel.add(nameEditPanel, BorderLayout.CENTER);
    JPanel descriptionPanel = new JPanel();
    descriptionPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    descriptionPanel.setLayout(new BorderLayout(0, 0));
    // NOI18N
    tabbedPane.addTab(ResourceLoader.getString("ot.tab.description"), null, descriptionPanel, null);
    descriptionTextArea = new EditLocalizedStringMultilinePanel(5, 5);
    // same font as script area
    descriptionTextArea.setFont(scriptEditBox.getScriptFont());
    descriptionPanel.add(descriptionTextArea);
    scriptCheckBox = new javax.swing.JCheckBox();
    scriptCheckBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            boolean isScript = scriptCheckBox.isSelected();
            scriptEditBox.setEnabled(isScript);
            extensionTextField.setEnabled(!isScript);
            if (isScript) {
                extensionTextField.setText(null);
                try {
                    scriptEditBox.setScript(Script.createScript(DEFAULT_OUTPUT_SCRIPT, Script.Language.GROOVY));
                } catch (GrafikonException e1) {
                    log.error("Error creating script.", e);
                }
            } else {
                scriptEditBox.setScript(null);
            }
        }
    });
    scriptEditBox.addComponentToEditBox(scriptCheckBox);
    pack();
}
Also used : FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) EditLocalizedStringMultilinePanel(net.parostroj.timetable.gui.components.EditLocalizedStringMultilinePanel) Font(java.awt.Font) BorderLayout(java.awt.BorderLayout) BorderLayout(java.awt.BorderLayout) java.awt.event(java.awt.event) AttributesPanel(net.parostroj.timetable.gui.components.AttributesPanel) EmptyBorder(javax.swing.border.EmptyBorder) Path(org.beanfabrics.Path) JButton(javax.swing.JButton) Font(java.awt.Font) AttributeReference(net.parostroj.timetable.utils.AttributeReference) javax.swing(javax.swing) EditLocalizedStringListAddRemovePanel(net.parostroj.timetable.gui.components.EditLocalizedStringListAddRemovePanel) ScriptEditBox(net.parostroj.timetable.gui.components.ScriptEditBox) EditLocalizedStringPanel(net.parostroj.timetable.gui.components.EditLocalizedStringPanel)

Example 3 with java.awt.event

use of java.awt.event in project intellij-community by JetBrains.

the class ChooseByNameBase method showTextFieldPanel.

protected void showTextFieldPanel() {
    final JLayeredPane layeredPane = getLayeredPane();
    final Dimension preferredTextFieldPanelSize = myTextFieldPanel.getPreferredSize();
    final int x = (layeredPane.getWidth() - preferredTextFieldPanelSize.width) / 2;
    final int paneHeight = layeredPane.getHeight();
    final int y = paneHeight / 3 - preferredTextFieldPanelSize.height / 2;
    VISIBLE_LIST_SIZE_LIMIT = Math.max(10, (paneHeight - (y + preferredTextFieldPanelSize.height)) / (preferredTextFieldPanelSize.height / 2) - 1);
    ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(myTextFieldPanel, myTextField);
    builder.setLocateWithinScreenBounds(false);
    builder.setKeyEventHandler(event -> {
        if (myTextPopup == null || !AbstractPopup.isCloseRequest(event) || !myTextPopup.isCancelKeyEnabled()) {
            return false;
        }
        IdeFocusManager focusManager = IdeFocusManager.getInstance(myProject);
        if (isDescendingFromTemporarilyFocusableToolWindow(focusManager.getFocusOwner())) {
            focusManager.requestFocus(myTextField, true);
            return false;
        } else {
            myTextPopup.cancel(event);
            return true;
        }
    }).setCancelCallback(() -> {
        myTextPopup = null;
        close(false);
        return Boolean.TRUE;
    }).setFocusable(true).setRequestFocus(true).setModalContext(false).setCancelOnClickOutside(false);
    Point point = new Point(x, y);
    SwingUtilities.convertPointToScreen(point, layeredPane);
    Rectangle bounds = new Rectangle(point, new Dimension(preferredTextFieldPanelSize.width + 20, preferredTextFieldPanelSize.height));
    myTextPopup = builder.createPopup();
    myTextPopup.setSize(bounds.getSize());
    myTextPopup.setLocation(bounds.getLocation());
    MnemonicHelper.init(myTextFieldPanel);
    if (myProject != null && !myProject.isDefault()) {
        DaemonCodeAnalyzer.getInstance(myProject).disableUpdateByTimer(myTextPopup);
    }
    Disposer.register(myTextPopup, new Disposable() {

        @Override
        public void dispose() {
            cancelListUpdater();
        }
    });
    myTextPopup.show(layeredPane);
}
Also used : ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) AllIcons(com.intellij.icons.AllIcons) ReadTask(com.intellij.openapi.progress.util.ReadTask) ModalityState(com.intellij.openapi.application.ModalityState) EditorUtil(com.intellij.openapi.editor.ex.util.EditorUtil) Task(com.intellij.openapi.progress.Task) TooManyUsagesStatus(com.intellij.openapi.progress.util.TooManyUsagesStatus) Disposer(com.intellij.openapi.util.Disposer) Matcher(com.intellij.util.text.Matcher) Logger(com.intellij.openapi.diagnostic.Logger) ListSelectionEvent(javax.swing.event.ListSelectionEvent) AttributeSet(javax.swing.text.AttributeSet) ProgressManager(com.intellij.openapi.progress.ProgressManager) DumbService(com.intellij.openapi.project.DumbService) ToolWindow(com.intellij.openapi.wm.ToolWindow) StatisticsInfo(com.intellij.psi.statistics.StatisticsInfo) WindowManager(com.intellij.openapi.wm.WindowManager) PopupOwner(com.intellij.ui.popup.PopupOwner) MacIntelliJTextFieldUI(com.intellij.ide.ui.laf.intellij.MacIntelliJTextFieldUI) AbstractPopup(com.intellij.ui.popup.AbstractPopup) BadLocationException(javax.swing.text.BadLocationException) com.intellij.openapi.ui.popup(com.intellij.openapi.ui.popup) PlainDocument(javax.swing.text.PlainDocument) KeymapUtil(com.intellij.openapi.keymap.KeymapUtil) com.intellij.ui(com.intellij.ui) UsageViewManagerImpl(com.intellij.usages.impl.UsageViewManagerImpl) UnknownFileType(com.intellij.openapi.fileTypes.UnknownFileType) IdeBundle(com.intellij.ide.IdeBundle) Nullable(org.jetbrains.annotations.Nullable) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) List(java.util.List) CopyReferenceAction(com.intellij.ide.actions.CopyReferenceAction) IdeFocusManager(com.intellij.openapi.wm.IdeFocusManager) PsiUtilCore(com.intellij.psi.util.PsiUtilCore) com.intellij.util.ui(com.intellij.util.ui) java.awt.event(java.awt.event) ApplicationManager(com.intellij.openapi.application.ApplicationManager) EmptyBorder(javax.swing.border.EmptyBorder) Registry(com.intellij.openapi.util.registry.Registry) WindowManagerEx(com.intellij.openapi.wm.ex.WindowManagerEx) NotNull(org.jetbrains.annotations.NotNull) Consumer(com.intellij.util.Consumer) ProgressIndicatorBase(com.intellij.openapi.progress.util.ProgressIndicatorBase) java.util(java.util) KeymapManager(com.intellij.openapi.keymap.KeymapManager) MinusculeMatcher(com.intellij.psi.codeStyle.MinusculeMatcher) MatcherHolder(com.intellij.util.text.MatcherHolder) NonNls(org.jetbrains.annotations.NonNls) UsageInfo(com.intellij.usageView.UsageInfo) MacIntelliJTextBorder(com.intellij.ide.ui.laf.intellij.MacIntelliJTextBorder) ProgressIndicatorUtils(com.intellij.openapi.progress.util.ProgressIndicatorUtils) DaemonCodeAnalyzer(com.intellij.codeInsight.daemon.DaemonCodeAnalyzer) ContainerUtil(com.intellij.util.containers.ContainerUtil) NameUtil(com.intellij.psi.codeStyle.NameUtil) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) StatisticsManager(com.intellij.psi.statistics.StatisticsManager) PopupUpdateProcessor(com.intellij.ui.popup.PopupUpdateProcessor) DarculaTextFieldUI(com.intellij.ide.ui.laf.darcula.ui.DarculaTextFieldUI) PsiElement(com.intellij.psi.PsiElement) Project(com.intellij.openapi.project.Project) PopupPositionManager(com.intellij.ui.popup.PopupPositionManager) DocumentEvent(javax.swing.event.DocumentEvent) DataManager(com.intellij.ide.DataManager) FileBasedIndex(com.intellij.util.indexing.FileBasedIndex) JBList(com.intellij.ui.components.JBList) Patches(com.intellij.Patches) StringUtil(com.intellij.openapi.util.text.StringUtil) com.intellij.usages(com.intellij.usages) GotoFileAction(com.intellij.ide.actions.GotoFileAction) FileTypeManagerEx(com.intellij.openapi.fileTypes.ex.FileTypeManagerEx) Disposable(com.intellij.openapi.Disposable) SystemInfo(com.intellij.openapi.util.SystemInfo) java.awt(java.awt) com.intellij.openapi.actionSystem(com.intellij.openapi.actionSystem) PsiElement2UsageTargetAdapter(com.intellij.find.findUsages.PsiElement2UsageTargetAdapter) DumbAwareAction(com.intellij.openapi.project.DumbAwareAction) Pair(com.intellij.openapi.util.Pair) MnemonicHelper(com.intellij.openapi.MnemonicHelper) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ListSelectionListener(javax.swing.event.ListSelectionListener) DarculaTextBorder(com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder) Alarm(com.intellij.util.Alarm) javax.swing(javax.swing) Disposable(com.intellij.openapi.Disposable) IdeFocusManager(com.intellij.openapi.wm.IdeFocusManager)

Example 4 with java.awt.event

use of java.awt.event in project intellij-community by JetBrains.

the class FindPopupPanel method initComponents.

private void initComponents() {
    myTitleLabel = new JBLabel(FindBundle.message("find.in.path.dialog.title"), UIUtil.ComponentStyle.REGULAR);
    myTitleLabel.setFont(myTitleLabel.getFont().deriveFont(Font.BOLD));
    myTitleLabel.setBorder(JBUI.Borders.empty(0, 4, 0, 16));
    myCbCaseSensitive = new StateRestoringCheckBox(FindBundle.message("find.popup.case.sensitive"));
    ItemListener liveResultsPreviewUpdateListener = new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            scheduleResultsUpdate();
        }
    };
    myCbCaseSensitive.addItemListener(liveResultsPreviewUpdateListener);
    myCbPreserveCase = new StateRestoringCheckBox(FindBundle.message("find.options.replace.preserve.case"));
    myCbPreserveCase.addItemListener(liveResultsPreviewUpdateListener);
    myCbPreserveCase.setVisible(myHelper.getModel().isReplaceState());
    myCbWholeWordsOnly = new StateRestoringCheckBox(FindBundle.message("find.popup.whole.words"));
    myCbWholeWordsOnly.addItemListener(liveResultsPreviewUpdateListener);
    myCbRegularExpressions = new StateRestoringCheckBox(FindBundle.message("find.popup.regex"));
    myCbRegularExpressions.addItemListener(liveResultsPreviewUpdateListener);
    myCbFileFilter = new StateRestoringCheckBox(FindBundle.message("find.popup.filemask"));
    myCbFileFilter.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            if (myCbFileFilter.isSelected()) {
                myFileMaskField.setEnabled(true);
                if (myCbFileFilter.getClientProperty("dontRequestFocus") == null) {
                    myFileMaskField.selectAll();
                    IdeFocusManager.getInstance(myProject).requestFocus(myFileMaskField, true);
                }
            } else {
                myFileMaskField.setEnabled(false);
                if (myCbFileFilter.getClientProperty("dontRequestFocus") == null) {
                    IdeFocusManager.getInstance(myProject).requestFocus(mySearchComponent, true);
                }
            }
        }
    });
    myCbFileFilter.addItemListener(liveResultsPreviewUpdateListener);
    myFileMaskField = new TextFieldWithAutoCompletion<String>(myProject, new TextFieldWithAutoCompletion.StringsCompletionProvider(myFileMasks, null), false, null) {

        @Override
        public void setEnabled(boolean enabled) {
            super.setEnabled(enabled);
            setBackground(enabled ? JBColor.background() : UIUtil.getComboBoxDisabledBackground());
        }
    };
    myFileMaskField.setPreferredWidth(JBUI.scale(100));
    myFileMaskField.addDocumentListener(new com.intellij.openapi.editor.event.DocumentAdapter() {

        @Override
        public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
            scheduleResultsUpdate();
        }
    });
    DefaultActionGroup switchContextGroup = new DefaultActionGroup();
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.ANY));
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.IN_COMMENTS));
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.IN_STRING_LITERALS));
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.EXCEPT_COMMENTS));
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.EXCEPT_STRING_LITERALS));
    switchContextGroup.add(new MySwitchContextToggleAction(FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS));
    switchContextGroup.setPopup(true);
    Presentation filterPresentation = new Presentation();
    filterPresentation.setIcon(AllIcons.General.Filter);
    AnAction myShowFilterPopupAction = new AnAction() {

        @Override
        public void actionPerformed(AnActionEvent e) {
            if (PlatformDataKeys.CONTEXT_COMPONENT.getData(e.getDataContext()) == null)
                return;
            ListPopup listPopup = JBPopupFactory.getInstance().createActionGroupPopup(null, switchContextGroup, e.getDataContext(), false, null, 10);
            listPopup.showUnderneathOf(myFilterContextButton);
        }
    };
    myFilterContextButton = new ActionButton(myShowFilterPopupAction, filterPresentation, ActionPlaces.UNKNOWN, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE) {

        @Override
        public int getPopState() {
            int state = super.getPopState();
            if (state != ActionButtonComponent.NORMAL)
                return state;
            return mySelectedContextName.equals(FindDialog.getPresentableName(FindModel.SearchContext.ANY)) ? ActionButtonComponent.NORMAL : ActionButtonComponent.PUSHED;
        }
    };
    myFilterContextButton.setFocusable(true);
    DefaultActionGroup tabResultsContextGroup = new DefaultActionGroup();
    tabResultsContextGroup.add(new ToggleAction(FindBundle.message("find.options.skip.results.tab.with.one.usage.checkbox")) {

        @Override
        public boolean isSelected(AnActionEvent e) {
            return FindSettings.getInstance().isSkipResultsWithOneUsage();
        }

        @Override
        public void setSelected(AnActionEvent e, boolean state) {
            myHelper.setSkipResultsWithOneUsage(state);
        }

        @Override
        public void update(@NotNull AnActionEvent e) {
            super.update(e);
            e.getPresentation().setVisible(!myHelper.isReplaceState());
        }
    });
    tabResultsContextGroup.add(new ToggleAction(FindBundle.message("find.open.in.new.tab.checkbox")) {

        @Override
        public boolean isSelected(AnActionEvent e) {
            return FindSettings.getInstance().isShowResultsInSeparateView();
        }

        @Override
        public void setSelected(AnActionEvent e, boolean state) {
            myHelper.setUseSeparateView(state);
        }
    });
    tabResultsContextGroup.setPopup(true);
    Presentation tabSettingsPresentation = new Presentation();
    tabSettingsPresentation.setIcon(AllIcons.General.SecondaryGroup);
    myTabResultsButton = new ActionButton(tabResultsContextGroup, tabSettingsPresentation, ActionPlaces.UNKNOWN, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE);
    myOKButton = new JButton(FindBundle.message("find.popup.find.button"));
    myOkActionListener = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            FindModel validateModel = myHelper.getModel().clone();
            applyTo(validateModel, false);
            ValidationInfo validationInfo = getValidationInfo(validateModel);
            if (validationInfo == null) {
                myHelper.getModel().copyFrom(validateModel);
                myHelper.updateFindSettings();
                myHelper.doOKAction();
            } else {
                String message = validationInfo.message;
                Messages.showMessageDialog(FindPopupPanel.this, message, CommonBundle.getErrorTitle(), Messages.getErrorIcon());
                return;
            }
            Disposer.dispose(myBalloon);
        }
    };
    myOKButton.addActionListener(myOkActionListener);
    registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (!myHelper.isReplaceState()) {
                navigateToSelectedUsage();
                return;
            }
            myOkActionListener.actionPerformed(e);
        }
    }, NEW_LINE, WHEN_IN_FOCUSED_WINDOW);
    registerKeyboardAction(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (myHelper.isReplaceState())
                return;
            myOkActionListener.actionPerformed(e);
        }
    }, OK_FIND, WHEN_IN_FOCUSED_WINDOW);
    mySearchComponent = new JTextArea();
    mySearchComponent.setColumns(25);
    mySearchComponent.setRows(1);
    myReplaceComponent = new JTextArea();
    myReplaceComponent.setColumns(25);
    myReplaceComponent.setRows(1);
    mySearchTextArea = new SearchTextArea(mySearchComponent, true, true);
    myReplaceTextArea = new SearchTextArea(myReplaceComponent, false, false);
    DocumentAdapter documentAdapter = new DocumentAdapter() {

        @Override
        protected void textChanged(DocumentEvent e) {
            mySearchComponent.setRows(Math.max(1, Math.min(3, StringUtil.countChars(mySearchComponent.getText(), '\n') + 1)));
            myReplaceComponent.setRows(Math.max(1, Math.min(3, StringUtil.countChars(myReplaceComponent.getText(), '\n') + 1)));
            if (myBalloon == null)
                return;
            if (e.getDocument() == mySearchComponent.getDocument()) {
                scheduleResultsUpdate();
            }
        }
    };
    mySearchComponent.getDocument().addDocumentListener(documentAdapter);
    myReplaceComponent.getDocument().addDocumentListener(documentAdapter);
    mySearchTextArea.setMultilineEnabled(false);
    myReplaceTextArea.setMultilineEnabled(false);
    Pair<FindPopupScopeUI.ScopeType, JComponent>[] scopeComponents = myScopeUI.getComponents();
    List<AnAction> scopeActions = new LinkedList<>();
    myScopeDetailsPanel = new JPanel(new CardLayout());
    for (Pair<FindPopupScopeUI.ScopeType, JComponent> scopeComponent : scopeComponents) {
        FindPopupScopeUI.ScopeType scopeType = scopeComponent.first;
        scopeActions.add(new MySelectScopeToggleAction(scopeType));
        myScopeDetailsPanel.add(scopeType.name, scopeComponent.second);
    }
    myScopeSelectionToolbar = createToolbar(scopeActions.toArray(AnAction.EMPTY_ARRAY));
    mySelectedScope = scopeComponents[0].first;
    myResultsPreviewTable = new JBTable() {

        @Override
        public Dimension getPreferredScrollableViewportSize() {
            return new Dimension(getWidth(), 1 + getRowHeight() * 4);
        }
    };
    myResultsPreviewTable.setFocusable(false);
    myResultsPreviewTable.getEmptyText().setShowAboveCenter(false);
    myResultsPreviewTable.setShowColumns(false);
    myResultsPreviewTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    myResultsPreviewTable.setShowGrid(false);
    myResultsPreviewTable.setIntercellSpacing(JBUI.emptySize());
    new DoubleClickListener() {

        @Override
        protected boolean onDoubleClick(MouseEvent event) {
            if (event.getSource() != myResultsPreviewTable)
                return false;
            navigateToSelectedUsage();
            return true;
        }
    }.installOn(myResultsPreviewTable);
    myResultsPreviewTable.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            myResultsPreviewTable.transferFocus();
        }
    });
    applyFont(JBUI.Fonts.label(), myCbCaseSensitive, myCbPreserveCase, myCbWholeWordsOnly, myCbRegularExpressions, myResultsPreviewTable);
    ScrollingUtil.installActions(myResultsPreviewTable, false, mySearchComponent);
    ScrollingUtil.installActions(myResultsPreviewTable, false, myReplaceComponent);
    UIUtil.redirectKeystrokes(myDisposable, mySearchComponent, myResultsPreviewTable, NEW_LINE);
    UIUtil.redirectKeystrokes(myDisposable, myReplaceComponent, myResultsPreviewTable, NEW_LINE);
    ActionListener helpAction = new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            HelpManager.getInstance().invokeHelp("reference.dialogs.findinpath");
        }
    };
    registerKeyboardAction(helpAction, KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
    registerKeyboardAction(helpAction, KeyStroke.getKeyStroke(KeyEvent.VK_HELP, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
    myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation(), Registry.is("ide.find.as.popup.editable.code")) {

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(myResultsPreviewTable.getWidth(), Math.max(getHeight(), getLineHeight() * 15));
        }
    };
    Disposer.register(myDisposable, myUsagePreviewPanel);
    myResultsPreviewTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting())
                return;
            int index = myResultsPreviewTable.getSelectedRow();
            if (index != -1) {
                UsageInfo usageInfo = ((UsageInfo2UsageAdapter) myResultsPreviewTable.getModel().getValueAt(index, 0)).getUsageInfo();
                myUsagePreviewPanel.updateLayout(usageInfo.isValid() ? Collections.singletonList(usageInfo) : null);
                VirtualFile file = usageInfo.getVirtualFile();
                String path = "";
                if (file != null) {
                    String relativePath = VfsUtilCore.getRelativePath(file, myProject.getBaseDir());
                    if (relativePath == null)
                        relativePath = file.getPath();
                    path = "<html><body>&nbsp;&nbsp;&nbsp;" + relativePath.replace(file.getName(), "<b>" + file.getName() + "</b>") + "</body></html>";
                }
                myUsagePreviewPanel.setBorder(IdeBorderFactory.createTitledBorder(path, false, new JBInsets(8, 0, -14, 0)));
            } else {
                myUsagePreviewPanel.updateLayout(null);
                myUsagePreviewPanel.setBorder(IdeBorderFactory.createBorder());
            }
        }
    });
    mySearchRescheduleOnCancellationsAlarm = new Alarm();
    JBSplitter splitter = new JBSplitter(true, .33f);
    splitter.setSplitterProportionKey(SPLITTER_SERVICE_KEY);
    splitter.setDividerWidth(JBUI.scale(2));
    splitter.getDivider().setBackground(OnePixelDivider.BACKGROUND);
    JBScrollPane scrollPane = new JBScrollPane(myResultsPreviewTable) {

        @Override
        public Dimension getMinimumSize() {
            Dimension size = super.getMinimumSize();
            size.height = myResultsPreviewTable.getPreferredScrollableViewportSize().height;
            return size;
        }
    };
    scrollPane.setBorder(IdeBorderFactory.createEmptyBorder());
    splitter.setFirstComponent(scrollPane);
    JPanel bottomPanel = new JPanel(new MigLayout("flowx, ins 4 4 0 4, fillx, hidemode 2, gap 0"));
    bottomPanel.add(myTabResultsButton);
    bottomPanel.add(Box.createHorizontalGlue(), "growx, pushx");
    myOKHintLabel = new JBLabel(KeymapUtil.getShortcutsText(new Shortcut[] { new KeyboardShortcut(OK_FIND, null) }));
    myOKHintLabel.setEnabled(false);
    bottomPanel.add(myOKHintLabel, "gapright 10");
    bottomPanel.add(myOKButton);
    myCodePreviewComponent = myUsagePreviewPanel.createComponent();
    splitter.setSecondComponent(myCodePreviewComponent);
    JPanel scopesPanel = new JPanel(new MigLayout("flowx, gap 26, ins 0"));
    scopesPanel.add(myScopeSelectionToolbar.getComponent());
    scopesPanel.add(myScopeDetailsPanel, "growx, pushx");
    setLayout(new MigLayout("flowx, ins 4, gap 0, fillx, hidemode 3"));
    int cbGapLeft = myCbCaseSensitive.getInsets().left;
    int cbGapRight = myCbCaseSensitive.getInsets().right;
    String cbGap = cbGapLeft + cbGapRight < 16 ? "gapright " + (16 - cbGapLeft - cbGapRight) : "";
    add(myTitleLabel, "sx 2, growx, pushx, growy");
    add(myCbCaseSensitive, cbGap);
    add(myCbPreserveCase, cbGap);
    add(myCbWholeWordsOnly, cbGap);
    add(myCbRegularExpressions, "gapright 0");
    add(RegExHelpPopup.createRegExLink("<html><body><b>?</b></body></html>", myCbRegularExpressions, LOG), "gapright " + (16 - cbGapLeft));
    add(myCbFileFilter);
    add(myFileMaskField, "gapright 16");
    add(myFilterContextButton, "wrap");
    add(mySearchTextArea, "pushx, growx, sx 10, gaptop 4, wrap");
    add(myReplaceTextArea, "pushx, growx, sx 10, gaptop 4, wrap");
    add(scopesPanel, "sx 10, pushx, growx, ax left, wrap, gaptop 4, gapbottom 4");
    add(splitter, "pushx, growx, growy, pushy, sx 10, wrap, pad -4 -4 4 4");
    add(bottomPanel, "pushx, growx, dock south, sx 10");
    MnemonicHelper.init(this);
    setFocusCycleRoot(true);
    setFocusTraversalPolicy(new ContainerOrderFocusTraversalPolicy() {

        @Override
        public Component getComponentAfter(Container container, Component c) {
            return (c == myResultsPreviewTable) ? mySearchComponent : super.getComponentAfter(container, c);
        }
    });
}
Also used : UsageViewPresentation(com.intellij.usages.UsageViewPresentation) UsagePreviewPanel(com.intellij.usages.impl.UsagePreviewPanel) JBInsets(com.intellij.util.ui.JBInsets) JBTable(com.intellij.ui.table.JBTable) ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton) JBLabel(com.intellij.ui.components.JBLabel) ListPopup(com.intellij.openapi.ui.popup.ListPopup) DocumentEvent(javax.swing.event.DocumentEvent) ListSelectionListener(javax.swing.event.ListSelectionListener) JBScrollPane(com.intellij.ui.components.JBScrollPane) VirtualFile(com.intellij.openapi.vfs.VirtualFile) ListSelectionEvent(javax.swing.event.ListSelectionEvent) java.awt.event(java.awt.event) UsageInfo(com.intellij.usageView.UsageInfo) MigLayout(net.miginfocom.swing.MigLayout) UsageViewPresentation(com.intellij.usages.UsageViewPresentation) FindUsagesProcessPresentation(com.intellij.usages.FindUsagesProcessPresentation) RelativePoint(com.intellij.ui.awt.RelativePoint) ValidationInfo(com.intellij.openapi.ui.ValidationInfo) Alarm(com.intellij.util.Alarm)

Example 5 with java.awt.event

use of java.awt.event in project WorldPainter by Captain-Chaos.

the class App method createLayerButton.

private List<Component> createLayerButton(final Layer layer, char mnemonic, boolean createSoloCheckbox, boolean createButton) {
    boolean readOnlyOperation = layer.equals(ReadOnly.INSTANCE);
    List<Component> components = new ArrayList<>(3);
    final JCheckBox checkBox = new JCheckBox();
    if (readOnlyOperation) {
        readOnlyCheckBox = checkBox;
    }
    checkBox.setToolTipText(strings.getString("whether.or.not.to.display.this.layer"));
    checkBox.setSelected(true);
    checkBox.addChangeListener(e -> {
        if (checkBox.isSelected()) {
            hiddenLayers.remove(layer);
        } else {
            hiddenLayers.add(layer);
        }
        updateLayerVisibility();
    });
    components.add(checkBox);
    if (createSoloCheckbox) {
        final JCheckBox soloCheckBox = new JCheckBox();
        if (readOnlyOperation) {
            readOnlySoloCheckBox = soloCheckBox;
        }
        layerSoloCheckBoxes.put(layer, soloCheckBox);
        soloCheckBox.setToolTipText("<html>Check to show <em>only</em> this layer (the other layers are still exported)</html>");
        soloCheckBox.addChangeListener(e -> {
            if (soloCheckBox.isSelected()) {
                layerSoloCheckBoxes.values().stream().filter(otherSoloCheckBox -> otherSoloCheckBox != soloCheckBox).forEach(otherSoloCheckBox -> otherSoloCheckBox.setSelected(false));
                soloLayer = layer;
            } else {
                soloLayer = null;
            }
            updateLayerVisibility();
        });
        components.add(soloCheckBox);
    } else {
        components.add(Box.createGlue());
    }
    if (createButton) {
        final JToggleButton button = new JToggleButton();
        if (readOnlyOperation) {
            readOnlyToggleButton = button;
        }
        button.setMargin(new Insets(2, 2, 2, 2));
        if (layer.getIcon() != null) {
            button.setIcon(new ImageIcon(layer.getIcon()));
        }
        button.setToolTipText(layer.getName() + ": " + layer.getDescription());
        // TODO: make this work again, but with Ctrl + Alt or something
        // if (mnemonic != 0) {
        // button.setMnemonic(mnemonic);
        // }
        button.addItemListener(event -> {
            if (event.getStateChange() == ItemEvent.SELECTED) {
                paintUpdater = () -> {
                    paint = PaintFactory.createLayerPaint(layer);
                    paintChanged();
                };
                paintUpdater.updatePaint();
            }
        });
        paintButtonGroup.add(button);
        button.setText(layer.getName());
        button.putClientProperty(HELP_KEY_KEY, "Layer/" + layer.getId());
        components.add(button);
    } else {
        JLabel label = new JLabel(layer.getName(), new ImageIcon(layer.getIcon()), JLabel.LEADING);
        label.putClientProperty(HELP_KEY_KEY, "Layer/" + layer.getId());
        components.add(label);
    }
    return components;
}
Also used : RemoteJCheckBox(org.pepsoft.util.swing.RemoteJCheckBox) GZIPInputStream(java.util.zip.GZIPInputStream) CustomBiome(org.pepsoft.worldpainter.biomeschemes.CustomBiome) UI_SCALE(org.pepsoft.util.GUIUtils.UI_SCALE) AutoBiomeScheme(org.pepsoft.worldpainter.biomeschemes.AutoBiomeScheme) TunnelLayerDialog(org.pepsoft.worldpainter.layers.tunnel.TunnelLayerDialog) TunnelLayer(org.pepsoft.worldpainter.layers.tunnel.TunnelLayer) Paint(org.pepsoft.worldpainter.painting.Paint) DockableFrame(com.jidesoft.docking.DockableFrame) org.pepsoft.worldpainter.painting(org.pepsoft.worldpainter.painting) SET_SPAWN_POINT(org.pepsoft.worldpainter.Platform.Capability.SET_SPAWN_POINT) BiomeSchemeManager(org.pepsoft.worldpainter.biomeschemes.BiomeSchemeManager) Timer(javax.swing.Timer) Void(java.lang.Void) DefaultFilter(org.pepsoft.worldpainter.panels.DefaultFilter) InfoPanel(org.pepsoft.worldpainter.panels.InfoPanel) KeyEvent(java.awt.event.KeyEvent) AffineTransform(java.awt.geom.AffineTransform) Box(javax.swing.Box) InvocationTargetException(java.lang.reflect.InvocationTargetException) Direction(org.pepsoft.minecraft.Direction) org.pepsoft.worldpainter.operations(org.pepsoft.worldpainter.operations) Brush(org.pepsoft.worldpainter.brushes.Brush) PropertyChangeListener(java.beans.PropertyChangeListener) SymmetricBrush(org.pepsoft.worldpainter.brushes.SymmetricBrush) EmptyBorder(javax.swing.border.EmptyBorder) GZIPOutputStream(java.util.zip.GZIPOutputStream) CustomItemsTreeModel(org.pepsoft.worldpainter.importing.CustomItemsTreeModel) GardenOfEdenOperation(org.pepsoft.worldpainter.gardenofeden.GardenOfEdenOperation) java.util(java.util) SimpleDateFormat(java.text.SimpleDateFormat) DOCK_SIDE_WEST(com.jidesoft.docking.DockContext.DOCK_SIDE_WEST) BrushOptions(org.pepsoft.worldpainter.panels.BrushOptions) AffineTransformOp(java.awt.image.AffineTransformOp) MapImportDialog(org.pepsoft.worldpainter.importing.MapImportDialog) com.jidesoft.docking(com.jidesoft.docking) RotatedBrush(org.pepsoft.worldpainter.brushes.RotatedBrush) BetterAction(org.pepsoft.worldpainter.util.BetterAction) ScriptRunner(org.pepsoft.worldpainter.tools.scripts.ScriptRunner) BevelBorder(javax.swing.border.BevelBorder) FileFilter(javax.swing.filechooser.FileFilter) CustomLayerProvider(org.pepsoft.worldpainter.plugins.CustomLayerProvider) java.awt(java.awt) RemoteJCheckBox(org.pepsoft.util.swing.RemoteJCheckBox) LayoutUtils(org.pepsoft.worldpainter.util.LayoutUtils) WPPluginManager(org.pepsoft.worldpainter.plugins.WPPluginManager) RespawnPlayerDialog(org.pepsoft.worldpainter.tools.RespawnPlayerDialog) URL(java.net.URL) EventVO(org.pepsoft.worldpainter.vo.EventVO) PropertyVetoException(java.beans.PropertyVetoException) TiledImageViewerContainer(org.pepsoft.util.swing.TiledImageViewerContainer) FLUIDS_AS_LAYER(org.pepsoft.worldpainter.TileRenderer.FLUIDS_AS_LAYER) CustomBiomeListener(org.pepsoft.worldpainter.biomeschemes.CustomBiomeManager.CustomBiomeListener) PlatformManager(org.pepsoft.worldpainter.plugins.PlatformManager) Material(org.pepsoft.minecraft.Material) BackupUtil(org.pepsoft.worldpainter.util.BackupUtil) BitmapBrush(org.pepsoft.worldpainter.brushes.BitmapBrush) UndergroundPocketsDialog(org.pepsoft.worldpainter.layers.pockets.UndergroundPocketsDialog) ImageIO(javax.imageio.ImageIO) WorldHistoryDialog(org.pepsoft.worldpainter.history.WorldHistoryDialog) BufferedImage(java.awt.image.BufferedImage) DynMapColourScheme(org.pepsoft.worldpainter.colourschemes.DynMapColourScheme) Collectors(java.util.stream.Collectors) JideLabel(com.jidesoft.swing.JideLabel) ProgressTask(org.pepsoft.util.swing.ProgressTask) List(java.util.List) Constants(org.pepsoft.minecraft.Constants) UndergroundPocketsLayer(org.pepsoft.worldpainter.layers.pockets.UndergroundPocketsLayer) org.pepsoft.worldpainter.selection(org.pepsoft.worldpainter.selection) java.awt.event(java.awt.event) BIOMES(org.pepsoft.worldpainter.Platform.Capability.BIOMES) GroundCoverLayer(org.pepsoft.worldpainter.layers.groundcover.GroundCoverLayer) CustomBiomeManager(org.pepsoft.worldpainter.biomeschemes.CustomBiomeManager) org.pepsoft.util(org.pepsoft.util) NonNls(org.jetbrains.annotations.NonNls) org.pepsoft.worldpainter.layers(org.pepsoft.worldpainter.layers) Listener(org.pepsoft.worldpainter.panels.BrushOptions.Listener) BufferedImageOp(java.awt.image.BufferedImageOp) ThreeDeeFrame(org.pepsoft.worldpainter.threedeeview.ThreeDeeFrame) MessageFormat(java.text.MessageFormat) VoidRenderer(org.pepsoft.worldpainter.layers.renderers.VoidRenderer) UndoManager(org.pepsoft.util.undo.UndoManager) UsageVO(org.pepsoft.worldpainter.vo.UsageVO) PropertyChangeEvent(java.beans.PropertyChangeEvent) Constants(org.pepsoft.worldpainter.Constants) TERRAIN_AS_LAYER(org.pepsoft.worldpainter.TileRenderer.TERRAIN_AS_LAYER) PlantLayer(org.pepsoft.worldpainter.layers.plants.PlantLayer) AttributeKeyVO(org.pepsoft.worldpainter.vo.AttributeKeyVO) MalformedURLException(java.net.MalformedURLException) BiomesViewerFrame(org.pepsoft.worldpainter.tools.BiomesViewerFrame) ProgressDialog(org.pepsoft.util.swing.ProgressDialog) HistoryEntry(org.pepsoft.worldpainter.history.HistoryEntry) JOptionPane(javax.swing.JOptionPane) Terrain(org.pepsoft.worldpainter.Terrain) DOCK_SIDE_EAST(com.jidesoft.docking.DockContext.DOCK_SIDE_EAST) URLEncoder(java.net.URLEncoder) java.io(java.io) OperationCancelled(org.pepsoft.util.ProgressReceiver.OperationCancelled) WritableRaster(java.awt.image.WritableRaster) ImportMaskDialog(org.pepsoft.worldpainter.importing.ImportMaskDialog) ImportCustomItemsDialog(org.pepsoft.worldpainter.importing.ImportCustomItemsDialog) javax.swing(javax.swing)

Aggregations

java.awt.event (java.awt.event)6 javax.swing (javax.swing)5 java.awt (java.awt)4 EmptyBorder (javax.swing.border.EmptyBorder)4 Alarm (com.intellij.util.Alarm)3 java.util (java.util)3 AllIcons (com.intellij.icons.AllIcons)2 MnemonicHelper (com.intellij.openapi.MnemonicHelper)2 ApplicationManager (com.intellij.openapi.application.ApplicationManager)2 UsageInfo (com.intellij.usageView.UsageInfo)2 BufferedImage (java.awt.image.BufferedImage)2 List (java.util.List)2 ImageIO (javax.imageio.ImageIO)2 DocumentEvent (javax.swing.event.DocumentEvent)2 ListSelectionEvent (javax.swing.event.ListSelectionEvent)2 ListSelectionListener (javax.swing.event.ListSelectionListener)2 FileFilter (javax.swing.filechooser.FileFilter)2 NonNls (org.jetbrains.annotations.NonNls)2 Constants (org.pepsoft.minecraft.Constants)2 AutoBiomeScheme (org.pepsoft.worldpainter.biomeschemes.AutoBiomeScheme)2