summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/MainPane.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/IceGridGUI/MainPane.java')
-rwxr-xr-xjava/src/IceGridGUI/MainPane.java174
1 files changed, 87 insertions, 87 deletions
diff --git a/java/src/IceGridGUI/MainPane.java b/java/src/IceGridGUI/MainPane.java
index 6fa4ea4603e..737a09f661b 100755
--- a/java/src/IceGridGUI/MainPane.java
+++ b/java/src/IceGridGUI/MainPane.java
@@ -19,134 +19,134 @@ public class MainPane extends JTabbedPane
{
public void addApplication(ApplicationPane application)
{
- IceGridGUI.Application.Root root = application.getRoot();
- super.addTab(computeTitle(root.getId()),
- getIcon(root), application);
+ IceGridGUI.Application.Root root = application.getRoot();
+ super.addTab(computeTitle(root.getId()),
+ getIcon(root), application);
}
public void setTitleAt(int index, String title)
{
- super.setTitleAt(index, computeTitle(title));
+ super.setTitleAt(index, computeTitle(title));
}
public void resetTitle(IceGridGUI.Application.Root root)
{
- int i = findIndex(root);
- if(i > 0)
- {
- setTitleAt(i, root.getId());
- }
+ int i = findIndex(root);
+ if(i > 0)
+ {
+ setTitleAt(i, root.getId());
+ }
}
public void resetIcon(IceGridGUI.Application.Root root)
{
- int i = findIndex(root);
- if(i > 0)
- {
- setIconAt(i, getIcon(root));
- }
+ int i = findIndex(root);
+ if(i > 0)
+ {
+ setIconAt(i, getIcon(root));
+ }
}
public int findIndex(IceGridGUI.Application.Root root)
{
- for(int i = 1; i < getTabCount(); ++i)
- {
- ApplicationPane pane = (ApplicationPane)getComponentAt(i);
- if(pane.getRoot() == root)
- {
- return i;
- }
- }
- return -1;
+ for(int i = 1; i < getTabCount(); ++i)
+ {
+ ApplicationPane pane = (ApplicationPane)getComponentAt(i);
+ if(pane.getRoot() == root)
+ {
+ return i;
+ }
+ }
+ return -1;
}
public ApplicationPane findApplication(IceGridGUI.Application.Root root)
{
- for(int i = 1; i < getTabCount(); ++i)
- {
- ApplicationPane pane = (ApplicationPane)getComponentAt(i);
- if(pane.getRoot() == root)
- {
- return pane;
- }
- }
- return null;
+ for(int i = 1; i < getTabCount(); ++i)
+ {
+ ApplicationPane pane = (ApplicationPane)getComponentAt(i);
+ if(pane.getRoot() == root)
+ {
+ return pane;
+ }
+ }
+ return null;
}
public void removeApplication(IceGridGUI.Application.Root root)
{
- for(int i = 1; i < getTabCount(); ++i)
- {
- ApplicationPane pane = (ApplicationPane)getComponentAt(i);
- if(pane.getRoot() == root)
- {
- removeTabAt(i);
- break;
- }
- }
+ for(int i = 1; i < getTabCount(); ++i)
+ {
+ ApplicationPane pane = (ApplicationPane)getComponentAt(i);
+ if(pane.getRoot() == root)
+ {
+ removeTabAt(i);
+ break;
+ }
+ }
}
MainPane(Coordinator coordinator)
{
- _coordinator = coordinator;
- setBorder(new EmptyBorder(10, 10, 10, 10));
-
- addChangeListener(new ChangeListener()
- {
- public void stateChanged(ChangeEvent evt)
- {
- Tab tab = (Tab)getSelectedComponent();
- tab.selected();
- }
- });
-
- _registryIcon = Utils.getIcon("/icons/16x16/registry_bound_application.png");
- _fileIcon = Utils.getIcon("/icons/16x16/file_bound_application.png");
-
- addTab("Live Deployment",
- Utils.getIcon("/icons/16x16/live_deployment.png"),
- _coordinator.getLiveDeploymentPane());
+ _coordinator = coordinator;
+ setBorder(new EmptyBorder(10, 10, 10, 10));
+
+ addChangeListener(new ChangeListener()
+ {
+ public void stateChanged(ChangeEvent evt)
+ {
+ Tab tab = (Tab)getSelectedComponent();
+ tab.selected();
+ }
+ });
+
+ _registryIcon = Utils.getIcon("/icons/16x16/registry_bound_application.png");
+ _fileIcon = Utils.getIcon("/icons/16x16/file_bound_application.png");
+
+ addTab("Live Deployment",
+ Utils.getIcon("/icons/16x16/live_deployment.png"),
+ _coordinator.getLiveDeploymentPane());
}
private String computeTitle(String name)
{
- String title = name;
- int i = 0;
- while(hasTitle(title))
- {
- title = name + " (" + Integer.toString(++i) + ")";
- }
- return title;
+ String title = name;
+ int i = 0;
+ while(hasTitle(title))
+ {
+ title = name + " (" + Integer.toString(++i) + ")";
+ }
+ return title;
}
private boolean hasTitle(String title)
{
- int tabCount = getTabCount();
- for(int i = 0; i < tabCount; ++i)
- {
- if(title.equals(getTitleAt(i)))
- {
- return true;
- }
- }
- return false;
+ int tabCount = getTabCount();
+ for(int i = 0; i < tabCount; ++i)
+ {
+ if(title.equals(getTitleAt(i)))
+ {
+ return true;
+ }
+ }
+ return false;
}
private ImageIcon getIcon(IceGridGUI.Application.Root root)
{
- if(root.isLive())
- {
- return _registryIcon;
- }
- else if(root.hasFile())
- {
- return _fileIcon;
- }
- else
- {
- return null;
- }
+ if(root.isLive())
+ {
+ return _registryIcon;
+ }
+ else if(root.hasFile())
+ {
+ return _fileIcon;
+ }
+ else
+ {
+ return null;
+ }
}