refresh() made nonstatic

This commit is contained in:
sidheshenator 2015-03-27 12:25:19 -04:00
parent cbaa15c437
commit feaaedbf7c
4 changed files with 7 additions and 12 deletions

View File

@ -83,7 +83,6 @@ import org.openide.util.actions.Presenter;
*/ */
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
CueBannerPanel.refresh();
if (Case.existsCurrentCase() == false) if (Case.existsCurrentCase() == false)
return; return;

View File

@ -126,9 +126,6 @@
<Events> <Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openRecentButtonActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openRecentButtonActionPerformed"/>
</Events> </Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="10"/>
</AuxValues>
</Component> </Component>
<Component class="javax.swing.JLabel" name="createNewLabel"> <Component class="javax.swing.JLabel" name="createNewLabel">
<Properties> <Properties>
@ -149,9 +146,6 @@
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CueBannerPanel.openRecentLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CueBannerPanel.openRecentLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="10"/>
</AuxValues>
</Component> </Component>
<Component class="javax.swing.JButton" name="openCaseButton"> <Component class="javax.swing.JButton" name="openCaseButton">
<Properties> <Properties>

View File

@ -47,6 +47,7 @@ public class CueBannerPanel extends javax.swing.JPanel {
public CueBannerPanel() { public CueBannerPanel() {
initComponents(); initComponents();
refresh();
} }
public CueBannerPanel(String welcomeLogo) { public CueBannerPanel(String welcomeLogo) {
@ -179,7 +180,7 @@ public class CueBannerPanel extends javax.swing.JPanel {
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
public static void refresh() { public void refresh() {
if (RecentCases.getInstance().getTotalRecentCases() == 0) { if (RecentCases.getInstance().getTotalRecentCases() == 0) {
openRecentButton.setEnabled(false); openRecentButton.setEnabled(false);
openRecentLabel.setEnabled(false); openRecentLabel.setEnabled(false);
@ -236,8 +237,8 @@ public class CueBannerPanel extends javax.swing.JPanel {
private javax.swing.JButton newCaseButton; private javax.swing.JButton newCaseButton;
private javax.swing.JButton openCaseButton; private javax.swing.JButton openCaseButton;
private javax.swing.JLabel openLabel; private javax.swing.JLabel openLabel;
private static javax.swing.JButton openRecentButton; private javax.swing.JButton openRecentButton;
private static javax.swing.JLabel openRecentLabel; private javax.swing.JLabel openRecentLabel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
/** /**

View File

@ -40,6 +40,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
private static StartupWindow instance; private static StartupWindow instance;
private static final String TITLE = NbBundle.getMessage(StartupWindow.class, "StartupWindow.title.text"); private static final String TITLE = NbBundle.getMessage(StartupWindow.class, "StartupWindow.title.text");
private static Dimension DIMENSIONS = new Dimension(750, 400); private static Dimension DIMENSIONS = new Dimension(750, 400);
CueBannerPanel welcomeWindow;
public StartupWindow() { public StartupWindow() {
super(WindowManager.getDefault().getMainWindow(), TITLE, true); super(WindowManager.getDefault().getMainWindow(), TITLE, true);
@ -62,8 +63,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
// set the location of the popUp Window on the center of the screen // set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
CueBannerPanel welcomeWindow = new CueBannerPanel(); welcomeWindow = new CueBannerPanel();
CueBannerPanel.refresh();
// add the command to close the window to the button on the Volume Detail Panel // add the command to close the window to the button on the Volume Detail Panel
welcomeWindow.setCloseButtonActionListener(new ActionListener() { welcomeWindow.setCloseButtonActionListener(new ActionListener() {
@ -82,6 +82,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
@Override @Override
public void open() { public void open() {
welcomeWindow.refresh();
setVisible(true); setVisible(true);
} }