Commit 3a10da49 authored by ludwig's avatar ludwig
Browse files

Fixed some icon issues. seems to work now

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@72 0463f305-d864-43cb-8a47-61cf597d4139
parent d27f6a32
......@@ -29,6 +29,10 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.ImageIcon;
public class Constants {
......@@ -517,4 +521,37 @@ public class Constants {
return( path.delete() );
}
public static URL getResourceUrl(String fileName){
try {
return new URL(TTT.class.getResource("Constants.class").toString().replaceFirst("ttt/Constants.class", "resources/"));
} catch (MalformedURLException e) {
System .out.println("File not found: " + fileName);
return null;
}
}
//Creates and returns an Image Icon
public static ImageIcon getIcon(String iconName) {
String iconPath = TTT.class.getResource("Constants.class").toString().replaceFirst("ttt/Constants.class", "resources/");
ImageIcon icon = new ImageIcon();
try{
URL x;
try {
x = new URL(iconPath + iconName);
icon = new ImageIcon(x);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
catch(NullPointerException e){
System.out.println("Couldn't find Icon Path: " + iconPath + iconName);
}
return icon;
}
}
......@@ -118,12 +118,11 @@ public class Recorder implements MessageConsumer, Closeable {
final String STOP = "stop";
final String PLAY = "play";
final Icon record_icon = new ImageIcon(this.getClass().getResource("../resources/Record24.gif"));
final Icon stop_icon = new ImageIcon(this.getClass().getResource("../resources/Stop24.gif"));
final Icon record_icon = Constants.getIcon("Record24.gif");
final Icon stop_icon =Constants.getIcon("esources/Stop24.gif");
final JButton recordButton = new RollOverButton(record_icon, RECORD);
final JButton playButton = new RollOverButton(
new ImageIcon(this.getClass().getResource("../resources/Play24.gif")), PLAY);
final JButton playButton = new RollOverButton(Constants.getIcon("Play24.gif"), PLAY);
recordButton.setEnabled(out == null);
playButton.setEnabled(false);
......@@ -179,12 +178,9 @@ public class Recorder implements MessageConsumer, Closeable {
final String STOP = "stop";
final String PLAY = "play";
final JButton recordButton = new RollOverButton(new ImageIcon(this.getClass().getResource(
"../resources/Record24.gif")), RECORD);
final JButton stopButton = new RollOverButton(
new ImageIcon(this.getClass().getResource("../resources/Stop24.gif")), STOP);
final JButton playButton = new RollOverButton(
new ImageIcon(this.getClass().getResource("../resources/Play24.gif")), PLAY);
final JButton recordButton = new RollOverButton(Constants.getIcon("Record24.gif"), RECORD);
final JButton stopButton = new RollOverButton(Constants.getIcon("Stop24.gif"), STOP);
final JButton playButton = new RollOverButton(Constants.getIcon("Play24.gif"), PLAY);
recordButton.setEnabled(out == null);
stopButton.setEnabled(out != null);
......@@ -270,8 +266,8 @@ public class Recorder implements MessageConsumer, Closeable {
final String RECORD = "record";
final String STOP = "stop";
final Icon record_icon = new ImageIcon(this.getClass().getResource("../resources/Record24.gif"));
final Icon stop_icon = new ImageIcon(this.getClass().getResource("../resources/Stop24.gif"));
final Icon record_icon = Constants.getIcon("Record24.gif");
final Icon stop_icon = Constants.getIcon("Stop24.gif");
final JButton recordButton = new RollOverButton(record_icon, RECORD);
......@@ -300,8 +296,8 @@ public class Recorder implements MessageConsumer, Closeable {
final String ZOOM_OUT = "minimize";
final String ZOOM_IN = "maximize";
final Icon zoom_in_icon = new ImageIcon(this.getClass().getResource("../resources/ZoomIn24.gif"));
final Icon zoom_out_icon = new ImageIcon(this.getClass().getResource("../resources/ZoomOut24.gif"));
final Icon zoom_in_icon = Constants.getIcon("ZoomIn24.gif");
final Icon zoom_out_icon = Constants.getIcon("ZoomOut24.gif");
final JButton zoomButton = new RollOverButton(zoom_in_icon, ZOOM_IN);
zoomButton.addActionListener(new ActionListener() {
......
......@@ -1122,7 +1122,7 @@ public class TTT extends JFrame {
public void addInternalFrameCentered(JInternalFrame frame) {
frame.pack();
frame.setFrameIcon(new ImageIcon(getClass().getResource("../resources/ttt16.png")));
frame.setFrameIcon(Constants.getIcon("ttt16.png"));
frame.setVisible(true);
Rectangle rect = TTT.getInstance().desktop.getBounds();
......@@ -1150,7 +1150,7 @@ public class TTT extends JFrame {
height = ttt.desktop.getHeight() - y;
if (width != internalFrame.getWidth() || height != internalFrame.getHeight())
internalFrame.setSize(width, height);
internalFrame.setFrameIcon(new ImageIcon(getClass().getResource("../resources/ttt16.png")));
internalFrame.setFrameIcon(Constants.getIcon("ttt16.png"));
ttt.desktop.add(internalFrame);
try {
internalFrame.setSelected(true);
......@@ -1284,14 +1284,10 @@ public class TTT extends JFrame {
infoPanel.add(new JLabel("The controls are placed in the top left corner"));
infoPanel.add(new JLabel("but can be dragged to any other position on screen."));
infoPanel.add(new JLabel(" "));
infoPanel.add(new JLabel("record", new ImageIcon(ttt.getClass().getResource(
"../resources/Record24.gif")), JLabel.LEFT));
infoPanel.add(new JLabel("stop recording", new ImageIcon(ttt.getClass().getResource(
"../resources/Stop24.gif")), JLabel.LEFT));
infoPanel.add(new JLabel("display TTT main window", new ImageIcon(ttt.getClass().getResource(
"../resources/ZoomIn24.gif")), JLabel.LEFT));
infoPanel.add(new JLabel("turn off TTT main window", new ImageIcon(ttt.getClass().getResource(
"../resources/ZoomOut24.gif")), JLabel.LEFT));
infoPanel.add(new JLabel("record", Constants.getIcon("Record24.gif"), JLabel.LEFT));
infoPanel.add(new JLabel("stop recording", Constants.getIcon("Stop24.gif"), JLabel.LEFT));
infoPanel.add(new JLabel("display TTT main window", Constants.getIcon("ZoomIn24.gif"), JLabel.LEFT));
infoPanel.add(new JLabel("turn off TTT main window", Constants.getIcon("ZoomOut24.gif"), JLabel.LEFT));
infoPanel.add(new JLabel(" "));
JCheckBox showAgainCheckBox = new JCheckBox("Don't show this message again.");
......@@ -1438,11 +1434,10 @@ public class TTT extends JFrame {
}
public static ImageIcon getIcon(String filename) {
System.out.println("TTT.class.getResource(Constants.class): " + TTT.class.getResource("Constants.class").toString());
String workaround = TTT.class.getResource("Constants.class").toString().replaceFirst("ttt/Constants.class", "resources/");
System.out.println(workaround + filename);
return new ImageIcon( workaround + filename);
String iconPath = TTT.class.getResource("Constants.class").toString().replaceFirst("ttt/Constants.class", "resources/");
return new ImageIcon( iconPath + filename);
}
}
......@@ -38,7 +38,7 @@ import java.io.DataOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import javax.imageio.ImageIO;
......@@ -498,10 +498,9 @@ public class Index {
private void createDefaultThumbnail() {
// define default thumbnail icon
URL url = TTT.getInstance().getClass().getResource("../resources/77.kitty.jpg");
if (url != null) {
// get image
Image image = Toolkit.getDefaultToolkit().getImage(url);
Image image = Constants.getIcon("77.kitty.jpg").getImage();
// wait until image is fully loaded and image dimensions can be determined
while (!Toolkit.getDefaultToolkit().prepareImage(image, -1, -1, null))
......@@ -517,10 +516,7 @@ public class Index {
// Image.SCALE_DEFAULT);
defaultThumbnail = image;
} else
// TODO fix error handling
defaultThumbnail = null;
}
// //////////////////////////////////////////////
......
// TeleTeachingTool - Presentation Recording With Automated Indexing
//
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universitt Mnchen
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universitt Mnchen
//
// This file is part of TeleTeachingTool.
//
......@@ -48,6 +48,7 @@ import javax.swing.event.CaretListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import ttt.Constants;
import ttt.record.Recording;
import ttt.record.TimeChangedListener;
......@@ -70,11 +71,11 @@ public class IndexViewer extends JPanel implements TimeChangedListener {
// search fields and buttons
// NOTE: there are to synchronized searchfields, one for each tab, because it looks better this way
JButton searchButton = new JButton(new ImageIcon(getClass().getResource("../../resources/FindAgain24.gif")));
JButton searchButton = new JButton(Constants.getIcon("FindAgain24.gif"));
searchButton.setMargin(new Insets(0, 0, 0, 0));
searchField = new JTextField();
JButton searchButton2 = new JButton(new ImageIcon(getClass().getResource("../../resources/FindAgain24.gif")));
JButton searchButton2 = new JButton(Constants.getIcon("FindAgain24.gif"));
searchButton2.setMargin(new Insets(0, 0, 0, 0));
searchField2 = new JTextField();
......@@ -112,12 +113,10 @@ public class IndexViewer extends JPanel implements TimeChangedListener {
annotationsOn.setMargin(new Insets(0, 0, 0, 0));
annotationsOn.setToolTipText("enable/disable annotations");
annotationsOn.setIcon(new NegatedImageIcon(this.getClass().getResource("../../resources/Freehand24_new.gif")));
annotationsOn.setSelectedIcon(new ImageIcon(this.getClass().getResource("../../resources/Freehand24_new.gif")));
annotationsOn.setRolloverIcon(new NegatedImageIcon(this.getClass().getResource(
"../../resources/Freehand_rollover24_new.gif")));
annotationsOn.setRolloverSelectedIcon(new ImageIcon(this.getClass().getResource(
"../../resources/Freehand_rollover24_new.gif")));
annotationsOn.setIcon(Constants.getIcon("Freehand24_new.gif"));
annotationsOn.setSelectedIcon(Constants.getIcon("Freehand24_new.gif"));
annotationsOn.setRolloverIcon(Constants.getIcon("Freehand_rollover24_new.gif"));
annotationsOn.setRolloverSelectedIcon(Constants.getIcon("Freehand_rollover24_new.gif"));
annotationsOn.setSelected(true);
final JCheckBox annotationsHighlightsOn = new JCheckBox();
......@@ -128,14 +127,10 @@ public class IndexViewer extends JPanel implements TimeChangedListener {
annotationsHighlightsOn.setMargin(new Insets(0, 0, 0, 0));
annotationsHighlightsOn.setToolTipText("enable/disable textmarker");
annotationsHighlightsOn.setIcon(new NegatedImageIcon(this.getClass().getResource(
"../../resources/Highlight24_new.gif")));
annotationsHighlightsOn.setSelectedIcon(new ImageIcon(this.getClass().getResource(
"../../resources/Highlight24_new.gif")));
annotationsHighlightsOn.setRolloverIcon(new NegatedImageIcon(this.getClass().getResource(
"../../resources/Highlight_rollover24_new.gif")));
annotationsHighlightsOn.setRolloverSelectedIcon(new ImageIcon(this.getClass().getResource(
"../../resources/Highlight_rollover24_new.gif")));
annotationsHighlightsOn.setIcon(Constants.getIcon("Highlight24_new.gif"));
annotationsHighlightsOn.setSelectedIcon(Constants.getIcon("Highlight24_new.gif"));
annotationsHighlightsOn.setRolloverIcon(Constants.getIcon("Highlight_rollover24_new.gif"));
annotationsHighlightsOn.setRolloverSelectedIcon(Constants.getIcon("Highlight_rollover24_new.gif"));
annotationsHighlightsOn.setSelected(true);
......
......@@ -70,11 +70,11 @@ public class WizardController extends javax.swing.JFrame {
} else {
jButtonNext.setText("Weiter");
jButtonCancel.setText("Abbrechen");
jButtonBack.setText("Zurck");
jButtonBack.setText("Zurck");
}
}
// getClass().getResource('ttt.wizard.resources\Recorder_32.gif')
/**
* This method is called from within the constructor to
......@@ -350,9 +350,9 @@ public class WizardController extends javax.swing.JFrame {
+"x"+screenSize.height+".\n" +
"A size of up to 1024x768 is recommended.","Warning: large resolution", JOptionPane.WARNING_MESSAGE);
} else{
JOptionPane.showMessageDialog(this, "Die aktuelle Desktop Auflsung betrgt: "+screenSize.width
JOptionPane.showMessageDialog(this, "Die aktuelle Desktop Auflsung betrgt: "+screenSize.width
+"x"+screenSize.height+".\n" +
"Eine Auflsung von 1024x768 wird empfohlen.","Warnung: zu hohe Auflsung", JOptionPane.WARNING_MESSAGE);
"Eine Auflsung von 1024x768 wird empfohlen.","Warnung: zu hohe Auflsung", JOptionPane.WARNING_MESSAGE);
}
}
......@@ -392,7 +392,7 @@ public class WizardController extends javax.swing.JFrame {
if(m_Language == "EN")
trayIcon.displayMessage("Info", "Use Right Mouse Button",TrayIcon.MessageType.INFO);
else
trayIcon.displayMessage("Info", "Bentzen Sie die rechte Maustaste",TrayIcon.MessageType.INFO);
trayIcon.displayMessage("Info", "Bentzen Sie die rechte Maustaste",TrayIcon.MessageType.INFO);
}
public void mouseEntered(MouseEvent e) {
......@@ -438,7 +438,7 @@ public class WizardController extends javax.swing.JFrame {
JOptionPane.showMessageDialog(null, "Could not find recording file or path." +
"Program will exit.");
else
JOptionPane.showMessageDialog(null, "Der Speicherort fr die Aufnahme existiert nicht." +
JOptionPane.showMessageDialog(null, "Der Speicherort fr die Aufnahme existiert nicht." +
"Das Programm wird beendet.");
//close VNC Server
......
......@@ -286,7 +286,7 @@ public final class TextAnnotation extends Annotation{
public void writeToFlash(FlashContext flashContext) throws IOException {
flashContext.checkNextFrame(this.timestamp);
FontDefinition fontDef = FontLoader.loadFont(this.getClass().getResourceAsStream("../../resources/VerdanaFont.swf"));
FontDefinition fontDef = FontLoader.loadFont(this.getClass().getResourceAsStream(Constants.getResourceUrl("VerdanaFont.swf").toString()));
Color txtColor = annotationColors[color];
com.anotherbigidea.flash.structs.Color flashColor = new com.anotherbigidea.flash.structs.Color(txtColor.getRed(), txtColor.getGreen(), txtColor.getBlue());
com.anotherbigidea.flash.movie.Font font = new com.anotherbigidea.flash.movie.Font(fontDef);
......
......@@ -4,7 +4,7 @@ import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;
import javax.swing.*;
......@@ -49,72 +49,44 @@ public class JClientPaintControls extends GradientPanel {
}
private void jbInit() throws Exception {
URL urlRect = this.getClass().getResource("../../../resources/Rectangle24_new.gif");
URL urlActiveRect = this.getClass().getResource("../../../resources/Rectangle_active24_new.gif");
URL urlRolloverRect = this.getClass().getResource("../../../resources/Rectangle_rollover24_new.gif");
URL urlLine = this.getClass().getResource("../../../resources/Line24.gif");
URL urlActiveLine = this.getClass().getResource("../../../resources/Line_active24.gif");
URL urlRolloverLine = this.getClass().getResource("../../../resources/Line_rollover24.gif");
URL urlFree = this.getClass().getResource("../../../resources/Freehand24_new.gif");
URL urlActiveFree = this.getClass().getResource("../../../resources/Freehand_active24_new.gif");
URL urlRolloverFree = this.getClass().getResource("../../../resources/Freehand_rollover24_new.gif");
URL urlHighlight = this.getClass().getResource("../../../resources/Highlight24_new.gif");
URL urlActiveHighlight = this.getClass().getResource("../../../resources/Highlight_active24_new.gif");
URL urlRolloverHighlight = this.getClass().getResource("../../../resources/Highlight_rollover24_new.gif");
URL urlDel = this.getClass().getResource("../../../resources/Delete24.gif");
URL urlActiveDel = this.getClass().getResource("../../../resources/Delete_active24.gif");
URL urlRolloverDel = this.getClass().getResource("../../../resources/Delete_rollover24.gif");
URL urlText = this.getClass().getResource("../../../resources/text24.png");
URL urlActiveText = this.getClass().getResource("../../../resources/text_active24.png");
URL urlRolloverText = this.getClass().getResource("../../../resources/text_rollover24.png");
URL urlDelAll = this.getClass().getResource("../../../resources/Delete_all16.gif");
URL urlActiveDelAll = this.getClass().getResource("../../../resources/Delete_all_active16.gif");
URL urldelSheetAnn = this.getClass().getResource("../../../resources/msgclient_delsheetann.png");
URL urlWB = this.getClass().getResource("../../../resources/msgclient_wb.png");
URL urlgetSheet = this.getClass().getResource("../../../resources/msgclient_getsheet.png");
URL urlgetSheetAnn = this.getClass().getResource("../../../resources/msgclient_getsheetann2.png");
URL urlVote = this.getClass().getResource("../../../resources/msgclient_vote.png");
colorButtons = new JRadioButton[5];
for (int i = 0; i < colorButtons.length; i++) {
colorButtons[i] = new JRadioButton();
}
// color buttons
// setBackground() does not work in MAC OS Look-and-Feel, so must use
// setBackground() does not work in MAC OS Look-andnew ImageIcon(urlRolloverDel)-Feel, so must use
// separate image files for each button
colorButtons[0].setBorder(BorderFactory.createEmptyBorder());
colorButtons[0].setToolTipText("Choose Color");
colorButtons[0].setIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button24_red.png")));
colorButtons[0].setSelectedIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_active24_red.png")));
colorButtons[0].setRolloverIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_rollover24_red.png")));
colorButtons[0].setIcon(Constants.getIcon("color_button24_red.png"));
colorButtons[0].setSelectedIcon(Constants.getIcon("color_button_active24_red.png"));
colorButtons[0].setRolloverIcon(Constants.getIcon("color_button_rollover24_red.png"));
colorButtons[1].setBorder(BorderFactory.createEmptyBorder());
colorButtons[1].setToolTipText("Choose Color");
colorButtons[1].setIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button24_blue.png")));
colorButtons[1].setSelectedIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_active24_blue.png")));
colorButtons[1].setRolloverIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_rollover24_blue.png")));
colorButtons[1].setIcon(Constants.getIcon("color_button24_blue.png"));
colorButtons[1].setSelectedIcon(Constants.getIcon("color_button_active24_blue.png"));
colorButtons[1].setRolloverIcon(Constants.getIcon("color_button_rollover24_blue.png"));
colorButtons[2].setBorder(BorderFactory.createEmptyBorder());
colorButtons[2].setToolTipText("Choose Color");
colorButtons[2].setIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button24_green.png")));
colorButtons[2].setSelectedIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_active24_green.png")));
colorButtons[2].setRolloverIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_rollover24_green.png")));
colorButtons[2].setIcon(Constants.getIcon("color_button24_green.png"));
colorButtons[2].setSelectedIcon(Constants.getIcon("color_button_active24_green.png"));
colorButtons[2].setRolloverIcon(Constants.getIcon("color_button_rollover24_green.png"));
colorButtons[3].setBorder(BorderFactory.createEmptyBorder());
colorButtons[3].setToolTipText("Choose Color");
colorButtons[3].setIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button24_yellow.png")));
colorButtons[3].setSelectedIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_active24_yellow.png")));
colorButtons[3].setRolloverIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_rollover24_yellow.png")));
colorButtons[3].setIcon(Constants.getIcon("color_button24_yellow.png"));
colorButtons[3].setSelectedIcon(Constants.getIcon("color_button_active24_yellow.png"));
colorButtons[3].setRolloverIcon(Constants.getIcon("color_button_rollover24_yellow.png"));
colorButtons[4].setBorder(BorderFactory.createEmptyBorder());
colorButtons[4].setToolTipText("Choose Color");
colorButtons[4].setIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button24_black.png")));
colorButtons[4].setSelectedIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_active24_black.png")));
colorButtons[4].setRolloverIcon(new ImageIcon(this.getClass().getResource("../../../resources/color_button_rollover24_black.png")));
colorButtons[4].setIcon(Constants.getIcon("color_button24_black.png"));
colorButtons[4].setSelectedIcon(Constants.getIcon("color_button_active24_black.png"));
colorButtons[4].setRolloverIcon(Constants.getIcon("color_button_rollover24_black.png"));
colorButtons[4].setSelected(true);
ButtonGroup colorGroup = new ButtonGroup();
......@@ -125,50 +97,50 @@ public class JClientPaintControls extends GradientPanel {
textButton = new JToggleButton();
textButton.setToolTipText("Text");
textButton.setBorder(BorderFactory.createEmptyBorder());
textButton.setIcon(new ImageIcon(urlText));
textButton.setSelectedIcon(new ImageIcon(urlActiveText));
textButton.setRolloverIcon(new ImageIcon(urlRolloverText));
textButton.setIcon(Constants.getIcon("text24.png"));
textButton.setSelectedIcon(Constants.getIcon("text_active24.png"));
textButton.setRolloverIcon(Constants.getIcon("text_rollover24.png"));
highlightButton = new JToggleButton();
highlightButton.setToolTipText("Highlight");
highlightButton.setBorder(BorderFactory.createEmptyBorder());
highlightButton.setIcon(new ImageIcon(urlHighlight));
highlightButton.setSelectedIcon(new ImageIcon(urlActiveHighlight));
highlightButton.setRolloverIcon(new ImageIcon(urlRolloverHighlight));
highlightButton.setIcon(Constants.getIcon("Highlight24_new.gif"));
highlightButton.setSelectedIcon(Constants.getIcon("Highlight_active24_new.gif"));
highlightButton.setRolloverIcon(Constants.getIcon("Highlight_rollover24_new.gif"));
freeButton = new JToggleButton();
freeButton.setToolTipText("Freehand");
freeButton.setBorder(BorderFactory.createEmptyBorder());
freeButton.setIcon(new ImageIcon(urlFree));
freeButton.setSelectedIcon(new ImageIcon(urlActiveFree));
freeButton.setRolloverIcon(new ImageIcon(urlRolloverFree));
freeButton.setIcon(Constants.getIcon("Freehand24_new.gif"));
freeButton.setSelectedIcon(Constants.getIcon("Freehand_active24_new.gif"));
freeButton.setRolloverIcon(Constants.getIcon("Freehand_rollover24_new.gif"));
rectangleButton = new JToggleButton();
rectangleButton.setToolTipText("Rectangle");
rectangleButton.setBorder(BorderFactory.createEmptyBorder());
rectangleButton.setIcon(new ImageIcon(urlRect));
rectangleButton.setSelectedIcon(new ImageIcon(urlActiveRect));
rectangleButton.setRolloverIcon(new ImageIcon(urlRolloverRect));
rectangleButton.setIcon(Constants.getIcon("Rectangle24_new.gif"));
rectangleButton.setSelectedIcon(Constants.getIcon("Rectangle_active24_new.gif"));
rectangleButton.setRolloverIcon(Constants.getIcon("Rectangle_rollover24_new.gif"));
lineButton = new JToggleButton();
lineButton.setToolTipText("Line");
lineButton.setBorder(BorderFactory.createEmptyBorder());
lineButton.setIcon(new ImageIcon(urlLine));
lineButton.setSelectedIcon(new ImageIcon(urlActiveLine));
lineButton.setRolloverIcon(new ImageIcon(urlRolloverLine));
lineButton.setIcon(Constants.getIcon("Line24.gif"));
lineButton.setSelectedIcon(Constants.getIcon("Line_active24.gif"));
lineButton.setRolloverIcon(Constants.getIcon("Line_rollover24.gif"));
deleteButton = new JToggleButton();
deleteButton.setToolTipText("Delete");
deleteButton.setBorder(BorderFactory.createEmptyBorder());
deleteButton.setIcon(new ImageIcon(urlDel));
deleteButton.setSelectedIcon(new ImageIcon(urlActiveDel));
deleteButton.setRolloverIcon(new ImageIcon(urlRolloverDel));
deleteButton.setIcon(Constants.getIcon("Delete24.gif"));
deleteButton.setSelectedIcon(Constants.getIcon("Delete_active24.gif"));
deleteButton.setRolloverIcon(Constants.getIcon("Delete_rollover24.gif"));
deleteAllButton = new JButton();
deleteAllButton.setToolTipText("Delete all your annotations");
deleteAllButton.setBorder(BorderFactory.createEmptyBorder());
deleteAllButton.setIcon(new ImageIcon(urlDelAll));
deleteAllButton.setSelectedIcon(new ImageIcon(urlActiveDelAll));
deleteAllButton.setIcon(Constants.getIcon("Delete_all16.gif"));
deleteAllButton.setSelectedIcon(Constants.getIcon("Delete_all_active16.gif"));
ButtonGroup modeButtons = new ButtonGroup();
modeButtons.add(textButton);
......@@ -196,27 +168,27 @@ public class JClientPaintControls extends GradientPanel {
add(Box.createRigidArea(new Dimension(20, 0)));
add(deleteAllButton);
btnDeleteSheetAnn = new JButton(new ImageIcon(urldelSheetAnn));
btnDeleteSheetAnn = new JButton(Constants.getIcon("msgclient_delsheetann.png"));
btnDeleteSheetAnn.setBorder(BorderFactory.createEmptyBorder());
btnDeleteSheetAnn.setToolTipText("delete all annotations which came with sheet");
add(btnDeleteSheetAnn);
add(Box.createGlue());
btnWB = new JButton(new ImageIcon(urlWB));
btnWB = new JButton(Constants.getIcon("msgclient_wb.png"));
btnWB.setToolTipText("new whiteboard");
add(btnWB);
JButton btnGetSheet = new JButton(new ImageIcon(urlgetSheet));
JButton btnGetSheet = new JButton(Constants.getIcon("msgclient_getsheet.png"));
btnGetSheet.setToolTipText("get current sheet");
btnGetSheet.setActionCommand("getSheet");
btnGetSheet.addActionListener(cc);
add(btnGetSheet);
JButton btnGetSheetAnn = new JButton(new ImageIcon(urlgetSheetAnn));
JButton btnGetSheetAnn = new JButton(Constants.getIcon("msgclient_getsheetann2.png"));
btnGetSheetAnn.setToolTipText("get current sheet or whiteboard with annotations");
btnGetSheetAnn.setActionCommand("getSheetAnn");
btnGetSheetAnn.addActionListener(cc);
add(btnGetSheetAnn);
add(Box.createRigidArea(new Dimension(20,0)));
btnVote = new JButton(new ImageIcon(urlVote));
btnVote = new JButton(Constants.getIcon("msgclient_vote.png"));
btnVote.setToolTipText("vote on polls");
btnVote.setBorder(BorderFactory.createEmptyBorder());
btnVote.addActionListener(cc);
......
......@@ -5,10 +5,10 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.net.Socket;
import java.net.URL;
import javax.swing.*;
import ttt.Constants;
import ttt.messaging.gui.LoginDialog;
/**
......@@ -47,12 +47,7 @@ public class TTTMessengerClient extends JFrame {
super.setTitle("TTT Messenger Client");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// get resources
URL urlSendText = this.getClass().getResource("../../../resources/msgclient_sendtext.png");
URL urlSendSheet = this.getClass().getResource("../../../resources/msgclient_sendsheet.png");
URL urlSendTextSheet = this.getClass().getResource("../../../resources/msgclient_sendtextsheet.png");
// create annotation drawing panel
JAnnotationPanel drawPanel = new JAnnotationPanel();
drawPanel.setMinimumSize(new Dimension(800,600));
......@@ -73,17 +68,17 @@ public class TTTMessengerClient extends JFrame {
pnlTxt.add(scrollTxt);
JButton btn1 = new JButton(new ImageIcon(urlSendText));
JButton btn1 = new JButton(Constants.getIcon("msgclient_sendtext.png"));
btn1.setActionCommand("send text");
btn1.setToolTipText("send text");
pnlTxt.add(btn1);
JButton btn2 = new JButton(new ImageIcon(urlSendTextSheet));
JButton btn2 = new JButton(Constants.getIcon("msgclient_sendtextsheet.png"));
btn2.setActionCommand("send text+sheet");
btn2.setToolTipText("send text and sheet");
pnlTxt.add(btn2);
JButton btn3 = new JButton(new ImageIcon(urlSendSheet));
JButton btn3 = new JButton(Constants.getIcon("msgclient_sendsheet.png"));
btn3.setActionCommand("send sheet");
btn3.setToolTipText("send sheet");
pnlTxt.add(btn3);
......
......@@ -17,6 +17,8 @@ import javax.imageio.ImageIO;
import javax.swing.JPanel;
import javax.swing.UIManager;
import ttt.Constants;