BowlerKernel
AbstractConnectionPanel.java
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright 2010 Neuron Robotics, LLC
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  ******************************************************************************/
15 package com.neuronrobotics.sdk.ui;
16 
17 import javax.swing.ImageIcon;
18 import javax.swing.JPanel;
19 
20 import com.neuronrobotics.sdk.common.BowlerAbstractConnection;
21 
22 // TODO: Auto-generated Javadoc
26 public abstract class AbstractConnectionPanel extends JPanel {
27 
29  private static final long serialVersionUID = 1L;
30 
32  private String title;
33 
35  private ImageIcon icon;
36 
39 
46 
50  public abstract void refresh();
51 
52 
53 
62  setTitle(title);
63 
64  setIcon(icon);
65  this.setConnectionDialog(connectionDialog);
66  }
67 
75  setTitle(title);
76  setIcon(ConnectionImageIconFactory.getIcon("images/connection-icon.png"));
77  this.setConnectionDialog(connectionDialog);
78  }
79 
85  public void setTitle(String title) {
86  this.title = title;
87  }
88 
94  public String getTitle() {
95  return title;
96  }
97 
103  public void setIcon(ImageIcon icon) {
104  this.icon = icon;
105  }
106 
112  public ImageIcon getIcon(){
113 
114  if(icon == null)
115  return new ImageIcon();
116  return icon;
117  }
118 
125  return connectionDialog;
126  }
127 
134  this.connectionDialog = connectionDialog;
135  }
136 }
AbstractConnectionPanel(String title, ImageIcon icon, ConnectionDialog connectionDialog)
AbstractConnectionPanel(String title, ConnectionDialog connectionDialog)
void setConnectionDialog(ConnectionDialog connectionDialog)
abstract BowlerAbstractConnection getConnection()