mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 18:30:43 +00:00
Disable context menus on editation
This commit is contained in:
@@ -51,6 +51,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
@@ -123,7 +124,7 @@ public class FolderPreviewPanel extends JPanel {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.getButton() == MouseEvent.BUTTON1 || selectedItems.isEmpty()) {
|
||||
if (SwingUtilities.isLeftMouseButton(e) || selectedItems.isEmpty()) {
|
||||
if (!e.isControlDown()) {
|
||||
selectedItems.clear();
|
||||
}
|
||||
@@ -148,7 +149,7 @@ public class FolderPreviewPanel extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
if (e.getButton() == MouseEvent.BUTTON3) {
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
mainPanel.getContextPopupMenu().update(new ArrayList<>(selectedItems.values()));
|
||||
mainPanel.getContextPopupMenu().show(FolderPreviewPanel.this, e.getX(), e.getY());
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
import javax.swing.plaf.basic.BasicLabelUI;
|
||||
@@ -456,7 +457,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
|
||||
if (selRow != -1 && selPath != null) {
|
||||
if (e.getClickCount() == 1) {
|
||||
if (e.getButton() == MouseEvent.BUTTON3) { //right click
|
||||
if (SwingUtilities.isRightMouseButton(e)) { //right click
|
||||
Object selObject = selPath.getLastPathComponent();
|
||||
if (selObject instanceof FieldNode) {
|
||||
final FieldNode fnode = (FieldNode) selObject;
|
||||
|
||||
@@ -102,7 +102,9 @@ import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.MouseInputAdapter;
|
||||
import jsyntaxpane.util.SwingUtils;
|
||||
import org.pushingpixels.substance.api.ColorSchemeAssociationKind;
|
||||
import org.pushingpixels.substance.api.ComponentState;
|
||||
import org.pushingpixels.substance.api.DecorationAreaType;
|
||||
@@ -549,7 +551,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
MouseInputAdapter mouseInputAdapter = new MouseInputAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
mouseMoved(e); //to correctly calculate mode, because moseMoved event is not called during dragging
|
||||
setDragStart(e.getPoint());
|
||||
|
||||
@@ -564,7 +566,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
dragStart = null;
|
||||
|
||||
if (freeTransformDepth > -1 && mode != Cursor.DEFAULT_CURSOR && registrationPointUpdated != null && transformUpdated != null) {
|
||||
|
||||
@@ -135,6 +135,7 @@ import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingWorker;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
@@ -2673,7 +2674,7 @@ public class Main {
|
||||
*/
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
Main.showProxy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,6 +452,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
|
||||
private void handleTreeKeyReleased(KeyEvent e) {
|
||||
if (checkEdited()) {
|
||||
return;
|
||||
}
|
||||
AbstractTagTree tree = (AbstractTagTree) e.getSource();
|
||||
if ((e.getKeyCode() == KeyEvent.VK_UP
|
||||
|| e.getKeyCode() == KeyEvent.VK_DOWN)
|
||||
@@ -514,6 +517,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
|
||||
private void handleTreeKeyPressed(KeyEvent e) {
|
||||
if (checkEdited()) {
|
||||
return;
|
||||
}
|
||||
AbstractTagTree tree = (AbstractTagTree) e.getSource();
|
||||
if ((e.getKeyCode() == 'F') && (e.isControlDown())) {
|
||||
if (tree == tagTree) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import java.util.List;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.tree.TreePath;
|
||||
@@ -124,10 +125,10 @@ public class PinButton extends JPanel {
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
//setBorder(loweredBorder);
|
||||
}
|
||||
if (e.getButton() == MouseEvent.BUTTON3) {
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
if (mainPanel.checkEdited()) {
|
||||
return;
|
||||
}
|
||||
List<TreeItem> itemList = new ArrayList<>();
|
||||
itemList.add(item);
|
||||
mainPanel.getContextPopupMenu().update(itemList);
|
||||
@@ -137,7 +138,7 @@ public class PinButton extends JPanel {
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
/*if (selected) {
|
||||
setBorder(loweredBorder);
|
||||
} else {
|
||||
@@ -223,7 +224,7 @@ public class PinButton extends JPanel {
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
PinButton.this.pinned = !PinButton.this.pinned;
|
||||
if (PinButton.this.pinned) {
|
||||
button.setToolTipText(AppStrings.translate("unpin"));
|
||||
|
||||
@@ -131,6 +131,7 @@ import javax.swing.JTabbedPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingWorker;
|
||||
import javax.swing.ToolTipManager;
|
||||
import javax.swing.border.BevelBorder;
|
||||
@@ -1293,7 +1294,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (ctrlDown && e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 1 && !decompiledTextArea.isEditable()) {
|
||||
if (ctrlDown && SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 1 && !decompiledTextArea.isEditable()) {
|
||||
ctrlDown = false;
|
||||
//decompiledTextArea.setCursor(Cursor.getDefaultCursor());
|
||||
//gotoDeclaration();
|
||||
|
||||
@@ -590,7 +590,9 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
|
||||
if (mainPanel.checkEdited()) {
|
||||
return;
|
||||
}
|
||||
int row = getTree().getClosestRowForLocation(e.getX(), e.getY());
|
||||
int[] selectionRows = getTree().getSelectionRows();
|
||||
if (!Helper.contains(selectionRows, row)) {
|
||||
|
||||
Reference in New Issue
Block a user