Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bduong/super-kids.git
Browse files Browse the repository at this point in the history
  • Loading branch information
btevfik committed Dec 11, 2012
2 parents 7f18014 + 4742907 commit f07c28c
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 30 deletions.
15 changes: 12 additions & 3 deletions GUI/src/main/java/com/ece/superkids/ui/customui/ImageButton.java
Expand Up @@ -17,7 +17,11 @@
import javax.swing.JButton;

/**
*
* This GUI class <code>ImageButton</code>
* extends JButton so that images get resized and center in the button
*
* Note getIcon() will return null
*
* @author david cheung
*/
public class ImageButton extends JButton {
Expand All @@ -26,13 +30,18 @@ public class ImageButton extends JButton {
private ImageObserver imageObserver;
private int iconwidth, iconheight;


/**
* This GUI class <code>ImageButton</code>
* extends JButton so that images get resized and center in the button
*
* Note getIcon() will return null
*/
public ImageButton() {
super();
}


@Override
@Override
public void setIcon(Icon icon)
{
super.setIcon(null);
Expand Down
15 changes: 9 additions & 6 deletions GUI/src/main/java/com/ece/superkids/ui/customui/ImageLabel.java
Expand Up @@ -4,10 +4,7 @@
*/
package com.ece.superkids.ui.customui;

/**
*
* @author david
*/

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
Expand All @@ -21,8 +18,10 @@
import javax.swing.JLabel;

/**
*
* @author david cheung
* This GUI class <code>ImageLabel</code>
* extends JLabel so that images get resized and center in the JLabel
*
* @author david
*/
public class ImageLabel extends JLabel {

Expand All @@ -31,6 +30,10 @@ public class ImageLabel extends JLabel {
private int iconwidth, iconheight;


/**
* This GUI class ImageLabel
* extends JLabel so that images get resized and center in the JLabel
*/
public ImageLabel() {
super();
}
Expand Down
36 changes: 32 additions & 4 deletions GUI/src/main/java/com/ece/superkids/ui/events/PanelListener.java
Expand Up @@ -4,25 +4,33 @@
*/
package com.ece.superkids.ui.events;

import com.ece.superkids.ui.frames.MainFrame;
import com.ece.superkids.ui.user.panels.StartScreenPanel;
import com.ece.superkids.ui.user.panels.UserSelectionPanel;
import java.awt.Component;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JPanel;
import com.ece.superkids.ui.frames.MainFrame;
import com.ece.superkids.ui.user.panels.StartScreenPanel;
import com.ece.superkids.ui.user.panels.UserSelectionPanel;

/**
*
* This listener class <code>PanelListerner</code> listens to changes made
* to the panels in the MainFrame
*
* @author baris
*/
public class PanelListener implements ComponentListener,
ItemListener {

private MainFrame frame;

/**
* Creates a new PanelListener listens to changes made
* to the panels in the MainFrame
*
* @param frame , The main frame of the game
*/
public PanelListener(MainFrame frame) {
this.frame = frame;
}
Expand All @@ -31,14 +39,26 @@ public void addPanel(JPanel panel) {
panel.addComponentListener(this);
}

/**
* Does nothing right now
* @param e
*/
public void componentResized(ComponentEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Does nothing right now
* @param e
*/
public void componentMoved(ComponentEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Does nothing right now
* @param e
*/
public void componentShown(ComponentEvent e) {
Component component = e.getComponent();
if (component.getName() != null && component.getName().equals("InitialSetup")) {
Expand Down Expand Up @@ -92,10 +112,18 @@ else if (component.getName() != null && component.getName().equals("Learning"))
}
}

/**
* Does nothing right now
* @param e
*/
public void componentHidden(ComponentEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}

/**
* Does nothing right now
* @param e
*/
public void itemStateChanged(ItemEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}
Expand Down
3 changes: 2 additions & 1 deletion GUI/src/main/java/com/ece/superkids/ui/events/Session.java
Expand Up @@ -7,7 +7,8 @@
import com.ece.superkids.users.entities.User;

/**
*
* This class <code>Session</code> handles the child user session.
*
* @author baris
*/
public class Session{
Expand Down
Expand Up @@ -5,13 +5,16 @@
package com.ece.superkids.ui.frames;

/**
*
* Creates new form <code>AboutFrame</code>
* About the game
*
* @author baris
*/
public class AboutFrame extends javax.swing.JFrame {

/**
* Creates new form AboutFrame
* About the game
*/
public AboutFrame() {
initComponents();
Expand Down
16 changes: 9 additions & 7 deletions GUI/src/main/java/com/ece/superkids/ui/frames/MainFrame.java
Expand Up @@ -5,8 +5,6 @@
package com.ece.superkids.ui.frames;

import com.ece.superkids.ui.user.frames.LogoutAuthFrame;
import com.ece.superkids.ui.user.panels.NewGamePanel;
import com.ece.superkids.ui.user.panels.SubjectSelectionPanel;
import com.ece.superkids.ui.user.panels.UserSelectionPanel;
import com.ece.superkids.ui.parent.frames.AuthFrame;
import com.ece.superkids.ui.parent.panels.InitialSetupPanel;
Expand All @@ -16,19 +14,23 @@
import com.ece.superkids.ui.events.Session;

/**
*
* @author david
* Creates new form <code>MainFrame</code>
* This is the main frame for the application
*
* @author david cheung
*/
public class MainFrame extends javax.swing.JFrame {

/**
* Creates new form MainFrame
*/

//get the panel controller to manage panels
private PanelController controller;
private ParentManager pM;
private Session session = Session.aSession();

/**
* Creates new form MainFrame
* This is the main frame for the application
*/
public MainFrame() {
initComponents();
//logout button is initally invisible
Expand Down
Expand Up @@ -4,23 +4,27 @@
*/
package com.ece.superkids.ui.parent.frames;

import com.ece.superkids.users.ParentManager;
import com.ece.superkids.users.UserDatabaseFactory;
import com.ece.superkids.ui.controllers.PanelController;
import com.ece.superkids.ui.parent.panels.ParentalControlPanel;
import com.ece.superkids.users.ParentManager;
import com.ece.superkids.users.UserDatabaseFactory;

/**
*
* Creates new form <code>AuthFrame</code>
* Authentication screen for logging into parent control panel
*
* @author baris
*/
public class AuthFrame extends javax.swing.JFrame {

/**
* Creates new form AuthFrame
*/

private ParentManager pM = UserDatabaseFactory.aParentManager();
private PanelController controller = PanelController.getInstance();

/**
* Creates new form AuthFrame
* Authentication screen for logging into parent control panel
*/
public AuthFrame() {
initComponents();
//center frame relative to screen
Expand Down
Expand Up @@ -8,15 +8,19 @@
import com.ece.superkids.users.UserDatabaseFactory;

/**
*
* Creates new form <code>ResetPasswordFrame</code>
* This form helps reset the password for the parent
*
* @author baris
*/
public class ResetPasswordFrame extends javax.swing.JFrame {


ParentManager pM = UserDatabaseFactory.aParentManager();
/**
* Creates new form ResetPasswordFrame
* This form helps reset the password for the parent
*/
ParentManager pM = UserDatabaseFactory.aParentManager();
public ResetPasswordFrame() {
initComponents();
setLocationRelativeTo(null);
Expand Down

0 comments on commit f07c28c

Please sign in to comment.