summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-12 09:55:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-11-12 11:03:29 +0000
commitbb437029c1e5331bcc3f8fb2fc87837142a52f33 (patch)
tree56bde4059792a5284e90ae3b10ee4388cc913a54 /toolkit
parent84f7f412bfc9e18b1ff8b133ceda7757eae28c36 (diff)
java: convert fields to local variables where possible
found by PMD Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542 Reviewed-on: https://gerrit.libreoffice.org/12376 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/test/accessibility/AccessibilityTree.java16
-rw-r--r--toolkit/test/accessibility/AccessibilityTreeModel.java5
-rw-r--r--toolkit/test/accessibility/AccessibilityWorkBench.java20
-rw-r--r--toolkit/test/accessibility/EventLogger.java12
-rw-r--r--toolkit/test/accessibility/ov/ContextView.java13
5 files changed, 23 insertions, 43 deletions
diff --git a/toolkit/test/accessibility/AccessibilityTree.java b/toolkit/test/accessibility/AccessibilityTree.java
index 72944e30e1ab..770ad1b187d6 100644
--- a/toolkit/test/accessibility/AccessibilityTree.java
+++ b/toolkit/test/accessibility/AccessibilityTree.java
@@ -107,8 +107,7 @@ public class AccessibilityTree
public void SetCanvas (Canvas aCanvas)
{
- maCanvas = aCanvas;
- ((AccessibilityTreeModel)maTree.getModel()).setCanvas (maCanvas);
+ ((AccessibilityTreeModel)maTree.getModel()).setCanvas(aCanvas);
}
/** Expand the nodes in the subtree rooted in aNode according to the the
@@ -383,14 +382,7 @@ public class AccessibilityTree
- protected AccessibleTreeCellRenderer
- maCellRenderer;
-
-
- private JTree
- maTree;
- private Canvas
- maCanvas;
- private int
- mnExpandLevel;
+ protected AccessibleTreeCellRenderer maCellRenderer;
+ private JTree maTree;
+ private int mnExpandLevel;
}
diff --git a/toolkit/test/accessibility/AccessibilityTreeModel.java b/toolkit/test/accessibility/AccessibilityTreeModel.java
index 55b56fef0e0f..ce6b5013583b 100644
--- a/toolkit/test/accessibility/AccessibilityTreeModel.java
+++ b/toolkit/test/accessibility/AccessibilityTreeModel.java
@@ -39,8 +39,7 @@ public class AccessibilityTreeModel
maNodeMap = new NodeMap();
- maEventListener = new EventListener (this);
- mxListener = new QueuedListener (maEventListener);
+ mxListener = new QueuedListener(new EventListener (this));
}
public void clear ()
@@ -501,6 +500,4 @@ public class AccessibilityTreeModel
private int mnLockCount;
private Canvas maCanvas;
-
- private EventListener maEventListener;
}
diff --git a/toolkit/test/accessibility/AccessibilityWorkBench.java b/toolkit/test/accessibility/AccessibilityWorkBench.java
index 98f9e5e2f750..a069c97b266d 100644
--- a/toolkit/test/accessibility/AccessibilityWorkBench.java
+++ b/toolkit/test/accessibility/AccessibilityWorkBench.java
@@ -169,11 +169,11 @@ public class AccessibilityWorkBench
aViewSplitPane.setDividerLocation (400);
// Text output area.
- maMessageArea = MessageArea.Instance ();
+ MessageArea aMessageArea = MessageArea.Instance ();
// Split pane for the two views and the message area.
JSplitPane aSplitPane = new JSplitPane (JSplitPane.VERTICAL_SPLIT,
- aViewSplitPane, maMessageArea);
+ aViewSplitPane, aMessageArea);
aSplitPane.setOneTouchExpandable(true);
addGridElement (aViewSplitPane, 0,0, 2,1, 3,3,
GridBagConstraints.CENTER, GridBagConstraints.BOTH);
@@ -253,11 +253,11 @@ public class AccessibilityWorkBench
JMenuBar CreateMenuBar ()
{
// Menu bar.
- maMenuBar = new JMenuBar ();
+ JMenuBar aMenuBar = new JMenuBar ();
// File menu.
JMenu aFileMenu = new JMenu ("File");
- maMenuBar.add (aFileMenu);
+ aMenuBar.add (aFileMenu);
JMenuItem aItem;
aItem = new JMenuItem ("Quit");
aFileMenu.add (aItem);
@@ -265,7 +265,7 @@ public class AccessibilityWorkBench
// View menu.
JMenu aViewMenu = new JMenu ("View");
- maMenuBar.add (aViewMenu);
+ aMenuBar.add (aViewMenu);
ButtonGroup aGroup = new ButtonGroup ();
JRadioButtonMenuItem aRadioButton = new JRadioButtonMenuItem ("Whole Screen");
aGroup.add (aRadioButton);
@@ -294,7 +294,7 @@ public class AccessibilityWorkBench
// Options menu.
JMenu aOptionsMenu = new JMenu ("Options");
- maMenuBar.add (aOptionsMenu);
+ aMenuBar.add (aOptionsMenu);
JCheckBoxMenuItem aCBItem;
aCBItem = new JCheckBoxMenuItem ("Show Descriptions", maCanvas.getShowDescriptions());
aOptionsMenu.add (aCBItem);
@@ -314,7 +314,7 @@ public class AccessibilityWorkBench
// Help menu.
JMenu aHelpMenu = new JMenu ("Help");
- maMenuBar.add (aHelpMenu);
+ aMenuBar.add (aHelpMenu);
aItem = new JMenuItem ("Help");
aHelpMenu.add (aItem);
@@ -328,7 +328,7 @@ public class AccessibilityWorkBench
aHelpMenu.add (aItem);
aItem.addActionListener (this);
- return maMenuBar;
+ return aMenuBar;
}
@@ -579,16 +579,12 @@ public class AccessibilityWorkBench
maAccessibilityTree;
private ObjectViewContainer
maObjectViewContainer;
- private MessageArea
- maMessageArea;
private JButton
aConnectButton,
aQuitButton,
aUpdateButton,
aExpandButton,
aShapesButton;
- private JMenuBar
- maMenuBar;
private boolean
mbInitialized;
private TopWindowListener
diff --git a/toolkit/test/accessibility/EventLogger.java b/toolkit/test/accessibility/EventLogger.java
index 5980f002153d..b6be2264a2f2 100644
--- a/toolkit/test/accessibility/EventLogger.java
+++ b/toolkit/test/accessibility/EventLogger.java
@@ -32,18 +32,16 @@ class EventLogger
{
try
{
- maFrame = new JFrame ();
- maLogger = new TextLogger ();
- maFrame.setContentPane (new JScrollPane (maLogger));
+ JFrame aFrame = new JFrame ();
+ TextLogger aLogger = new TextLogger ();
+ aFrame.setContentPane (new JScrollPane (aLogger));
- maFrame.setSize (400,300);
- maFrame.setVisible (true);
+ aFrame.setSize (400,300);
+ aFrame.setVisible (true);
}
catch (Exception e)
{}
}
private static EventLogger maInstance = null;
- private JFrame maFrame;
- private TextLogger maLogger;
}
diff --git a/toolkit/test/accessibility/ov/ContextView.java b/toolkit/test/accessibility/ov/ContextView.java
index e3144ccb37b2..a687d7eb61d5 100644
--- a/toolkit/test/accessibility/ov/ContextView.java
+++ b/toolkit/test/accessibility/ov/ContextView.java
@@ -50,11 +50,11 @@ public class ContextView
public ContextView (ObjectViewContainer aContainer)
{
super (aContainer);
- maNameLabel = new JLabel ("Name: ");
+ JLabel aNameLabel = new JLabel ("Name: ");
maName = new JLabel ("");
- maDescriptionLabel = new JLabel ("Description: ");
+ JLabel aDescriptionLabel = new JLabel ("Description: ");
maDescription = new JLabel ("");
- maRoleLabel = new JLabel ("Role: ");
+ JLabel maRoleLabel = new JLabel ("Role: ");
maRole = new JLabel ("");
// Make the background of name and description white and opaque so
@@ -77,9 +77,9 @@ public class ContextView
constraints.weighty = 1;
constraints.anchor = GridBagConstraints.WEST;
constraints.fill = GridBagConstraints.NONE;
- add (maNameLabel, constraints);
+ add (aNameLabel, constraints);
constraints.gridy = 1;
- add (maDescriptionLabel, constraints);
+ add (aDescriptionLabel, constraints);
constraints.gridy = 2;
add (maRoleLabel, constraints);
constraints.gridy = 0;
@@ -134,10 +134,7 @@ public class ContextView
private JLabel
- maNameLabel,
maName,
- maDescriptionLabel,
maDescription,
- maRoleLabel,
maRole;
}