public class Gui
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Gui.CellListener
This class is used to add some form listening from the user mouse to the
specified cell.
|
class |
Gui.KeyDispatcher
A class to dispatch Key events
|
private class |
Gui.MyListCellRenderer
This little class is so the agents in the list panel can still display
the background behind it.
|
Modifier and Type | Field and Description |
---|---|
private javax.swing.DefaultListModel |
agentListModel
These are other elements that belong to a certain panel.
|
private javax.swing.JScrollPane |
agentScrollPane |
private HeinekenList |
agentsList |
private HeinekenPanel |
agentsPanel
These are the various panels needed.
|
private javax.swing.JButton |
chatButton |
private HeinekenPanel |
chatPanel
These are the various panels needed.
|
private HeinekenTextField |
chatText |
private javax.swing.JScrollPane |
chatTextPane |
private NetPuzlClient |
client |
private TransparentPanel |
drawPanel |
private HeinekenPanel |
eastPanel
These are the various panels needed.
|
private java.awt.Color |
HEINEKEN_GREEN
A nice Heineken green color.
|
private HeinekenList |
imageList |
private javax.swing.DefaultListModel |
imageListModel |
private HeinekenPanel |
imagePanel
These are the various panels needed.
|
private javax.swing.JScrollPane |
imageScrollPane |
private HeinekenPanel |
infoPanel
These are the various panels needed.
|
private javax.swing.JScrollPane |
infoScrollPane |
private javax.swing.DefaultListModel |
keyListModel |
private HeinekenPanel |
keyPanel
These are the various panels needed.
|
private javax.swing.JScrollPane |
keyScrollPane |
private HeinekenList |
keysList |
private javax.swing.JFrame |
mainFrame
This is the window.
|
private Matrix |
matrix |
private HeinekenList |
matrixList |
private javax.swing.DefaultListModel |
matrixListModel |
private HeinekenPanel |
matrixPanel
These are the various panels needed.
|
private javax.swing.JScrollPane |
matrixScrollPane |
private javax.swing.JMenuItem |
menuAbout |
private javax.swing.JMenuBar |
menuBar
This is all the stuff for the menu bar.
|
private javax.swing.JMenu |
menuFile |
private javax.swing.JMenu |
menuHelp |
private javax.swing.JMenuItem |
menuLogout |
private javax.swing.JMenuItem |
menuStatus |
private HeinekenTextArea |
recievedText |
private HeinekenPanel |
recievePanel
These are the various panels needed.
|
private javax.swing.JTabbedPane |
sayToPane |
private HeinekenPanel |
sendPanel
These are the various panels needed.
|
private static java.awt.Dimension |
SIZE
The Dimension constant
|
private HeinekenTextArea |
tokenAttr |
private javax.swing.DefaultListModel |
tokenListModel |
private HeinekenPanel |
tokenPanel
These are the various panels needed.
|
private javax.swing.JScrollPane |
tokenScrollPane |
private HeinekenList |
tokensList |
private javax.swing.JCheckBox |
whisperCheck |
Constructor and Description |
---|
Gui()
This method is used for testing so that we don't have to build a client
or a server just see the eye candy.
|
Gui(NetPuzlClient client)
This is the constructor for this class, needs a client so that it can
send Tags to its proxy.
|
Modifier and Type | Method and Description |
---|---|
static void |
addEnterKeyPress(javax.swing.JButton button)
This method is used so that a button can be pressed when it has focus, by
the enter key.
|
void |
addMatrix(ClientMatrix matrix)
This method is used when adding all the matrix components (Cells), to be
drawn on the screen.
|
void |
buildAgentPanel()
This method builds that agentPanel the panel that displays all the
information about all the agents in the current matrix.
|
void |
buildCenterPanel()
This method builds the drawable surface of the gui.
|
void |
buildEastPanel()
This method builds the EastPanel where all the tabbed panels are.
|
void |
buildGUI()
This method builds the entire look and feel of this window.
|
void |
buildImagePanel()
Builds a Heineken Image panel
|
void |
buildInfoPanel()
This is the tabbed panel that displays the token info.
|
void |
buildKeyPanel()
This is the tabbed panel where keys will be drawn.
|
void |
buildMatrixPanel()
This method builds the the matrix panel where the matricies are drawn.
|
void |
buildMenu()
This method is used to build the menu.
|
void |
buildSayToPane()
Builds a tabbed pane for talking to NetPuzlObjects
|
void |
buildSouthPanel()
This builds the chatPanel where all messages to this client are seen.
|
void |
buildTokenPanel()
This is the tabbed panel where the token info is displayed.
|
javax.swing.DefaultListModel |
getAgentListModel()
A getter method for the agent list model.
|
java.lang.String |
getChatText()
This method is used when chatting to retrieve the input text from the
user.
|
javax.swing.JFrame |
getFrame()
A getter method for the frame of this GUI.
|
javax.swing.DefaultListModel |
getImageListModel() |
javax.swing.DefaultListModel |
getKeyListModel() |
Matrix |
getMatrix()
A getter method for the the current matrix.
|
javax.swing.DefaultListModel |
getMatrixListModel() |
javax.swing.JTextArea |
getRecievedText() |
private Gui |
getThis()
This method is used to pass a reference to this when inside an anonymous
class to be able to reference the GUI's methods
|
javax.swing.DefaultListModel |
getTokenListModel()
A getter method for the token list model.
|
private void |
prefAction()
This is some common behavior between actions.
|
void |
sendMessageToChatHistory(java.lang.String from,
java.lang.String to,
java.lang.String message)
Sends a message to the chat history box
|
private void |
sendTag(Tag tag)
This method is used to send a tag to the clients' proxy.
|
private void |
setAgentListModel(javax.swing.DefaultListModel listModel)
A setter method for the agents list model.
|
void |
setChatText(java.lang.String str)
This method is used to reset the text of the chat.
|
void |
setFrame(javax.swing.JFrame frame)
This method is used to change the frame of this GUI.
|
private void |
setImageListModel(javax.swing.DefaultListModel defaultListModel) |
private void |
setKeyListModel(javax.swing.DefaultListModel defaultListModel)
A setter method for the key list model.
|
void |
setMatrix(ClientMatrix matrix)
This method is used to set the matrix that the client will be in.
|
private void |
setMatrixListModel(javax.swing.DefaultListModel defaultListModel)
A setter method for the matrix list model.
|
void |
setRecievedText(HeinekenTextArea recievedText)
A setter method for the recieved text area.
|
private void |
setTokenListModel(javax.swing.DefaultListModel defaultListModel)
A setter method for the token list model.
|
private void |
talkToNetPuzlObject(NetPuzlObject npo,
java.lang.String message) |
private void |
whisperToNetPuzlObject(NetPuzlObject npo,
java.lang.String message) |
private static java.awt.Dimension SIZE
private javax.swing.JFrame mainFrame
private HeinekenPanel agentsPanel
private HeinekenPanel tokenPanel
private HeinekenPanel keyPanel
private HeinekenPanel matrixPanel
private HeinekenPanel imagePanel
private HeinekenPanel chatPanel
private HeinekenPanel sendPanel
private HeinekenPanel recievePanel
private HeinekenPanel infoPanel
private HeinekenPanel eastPanel
private TransparentPanel drawPanel
private javax.swing.JTabbedPane sayToPane
private javax.swing.JScrollPane agentScrollPane
private javax.swing.JScrollPane keyScrollPane
private javax.swing.JScrollPane tokenScrollPane
private javax.swing.JScrollPane matrixScrollPane
private javax.swing.JScrollPane imageScrollPane
private javax.swing.JScrollPane chatTextPane
private javax.swing.JScrollPane infoScrollPane
private javax.swing.JMenuBar menuBar
private javax.swing.JMenu menuFile
private javax.swing.JMenu menuHelp
private javax.swing.JMenuItem menuAbout
private javax.swing.JMenuItem menuLogout
private javax.swing.JMenuItem menuStatus
private javax.swing.DefaultListModel agentListModel
private javax.swing.DefaultListModel tokenListModel
private javax.swing.DefaultListModel keyListModel
private javax.swing.DefaultListModel matrixListModel
private javax.swing.DefaultListModel imageListModel
private HeinekenList agentsList
private HeinekenList tokensList
private HeinekenList keysList
private HeinekenList matrixList
private HeinekenList imageList
private HeinekenTextField chatText
private HeinekenTextArea recievedText
private HeinekenTextArea tokenAttr
private javax.swing.JButton chatButton
private javax.swing.JCheckBox whisperCheck
private Matrix matrix
private NetPuzlClient client
private final java.awt.Color HEINEKEN_GREEN
public Gui()
public Gui(NetPuzlClient client)
client
- The client that this GUI should be associated with.private void prefAction()
private void whisperToNetPuzlObject(NetPuzlObject npo, java.lang.String message)
private void talkToNetPuzlObject(NetPuzlObject npo, java.lang.String message)
public static void addEnterKeyPress(javax.swing.JButton button)
button
- The button that wants to pressed by the enter key.public void addMatrix(ClientMatrix matrix)
public void buildAgentPanel()
public void buildImagePanel()
private void setImageListModel(javax.swing.DefaultListModel defaultListModel)
public void buildCenterPanel()
public void buildEastPanel()
public void buildGUI()
public void buildInfoPanel()
public void buildKeyPanel()
public void buildMatrixPanel()
public void buildMenu()
public void buildSayToPane()
public void buildSouthPanel()
public void buildTokenPanel()
public javax.swing.DefaultListModel getAgentListModel()
public java.lang.String getChatText()
public javax.swing.JFrame getFrame()
public javax.swing.DefaultListModel getKeyListModel()
public Matrix getMatrix()
public javax.swing.DefaultListModel getMatrixListModel()
public javax.swing.JTextArea getRecievedText()
private Gui getThis()
public javax.swing.DefaultListModel getTokenListModel()
private void sendTag(Tag tag)
tag
- The tag to be sent to the proxy.private void setAgentListModel(javax.swing.DefaultListModel listModel)
listModel
- the listModel to setpublic void setChatText(java.lang.String str)
public void setFrame(javax.swing.JFrame frame)
private void setKeyListModel(javax.swing.DefaultListModel defaultListModel)
defaultListModel
- The new keyListModel.public void setMatrix(ClientMatrix matrix)
private void setMatrixListModel(javax.swing.DefaultListModel defaultListModel)
defaultListModel
- The new matrixListModel.public void setRecievedText(HeinekenTextArea recievedText)
recievedText
- the recievedText to setprivate void setTokenListModel(javax.swing.DefaultListModel defaultListModel)
defaultListModel
- The new tokenListModel.public void sendMessageToChatHistory(java.lang.String from, java.lang.String to, java.lang.String message)
from
- Who the message is fromto
- Who the message is tomessage
- The message sentpublic javax.swing.DefaultListModel getImageListModel()