|
|
|
|
@ -15,13 +15,12 @@
|
|
|
|
|
import javax.swing.text.*;
|
|
|
|
|
import javax.swing.text.html.*;
|
|
|
|
|
|
|
|
|
|
import say.swing.*;
|
|
|
|
|
|
|
|
|
|
import net.java.sip.communicator.impl.gui.customcontrols.*;
|
|
|
|
|
import net.java.sip.communicator.impl.gui.i18n.*;
|
|
|
|
|
import net.java.sip.communicator.impl.gui.main.chat.*;
|
|
|
|
|
import net.java.sip.communicator.impl.gui.utils.*;
|
|
|
|
|
import net.java.sip.communicator.util.*;
|
|
|
|
|
import say.swing.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>EditTextToolBar</tt> is a <tt>JToolBar</tt> which contains
|
|
|
|
|
@ -37,11 +36,6 @@ public class EditTextToolBar
|
|
|
|
|
{
|
|
|
|
|
private Logger logger = Logger.getLogger(EditTextToolBar.class);
|
|
|
|
|
|
|
|
|
|
private Integer[] fontSizeConstants =
|
|
|
|
|
new Integer[]
|
|
|
|
|
{ 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64,
|
|
|
|
|
72, 96, 144, 288 };
|
|
|
|
|
|
|
|
|
|
private ChatWritePanel chatWritePanel;
|
|
|
|
|
|
|
|
|
|
private JEditorPane chatEditorPane;
|
|
|
|
|
@ -63,6 +57,8 @@ public class EditTextToolBar
|
|
|
|
|
|
|
|
|
|
private JToggleButton underlineButton;
|
|
|
|
|
|
|
|
|
|
private ColorLabel colorLabel;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance and constructs the <tt>EditTextToolBar</tt>.
|
|
|
|
|
*/
|
|
|
|
|
@ -117,6 +113,8 @@ else if (italicButton.isSelected())
|
|
|
|
|
|
|
|
|
|
int result = fontChooser.showDialog(chatWritePanel);
|
|
|
|
|
|
|
|
|
|
chatEditorPane.requestFocus();
|
|
|
|
|
|
|
|
|
|
if (result == JFontChooser.OK_OPTION)
|
|
|
|
|
{
|
|
|
|
|
String fontName = fontChooser.getSelectedFontFamily();
|
|
|
|
|
@ -178,8 +176,6 @@ else if (fontStyle == (Font.BOLD + Font.ITALIC))
|
|
|
|
|
if (italicButton.isSelected())
|
|
|
|
|
italicButton.doClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chatEditorPane.requestFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -190,7 +186,7 @@ else if (fontStyle == (Font.BOLD + Font.ITALIC))
|
|
|
|
|
*/
|
|
|
|
|
private void initColorLabel()
|
|
|
|
|
{
|
|
|
|
|
final ColorLabel colorLabel = new ColorLabel();
|
|
|
|
|
this.colorLabel = new ColorLabel();
|
|
|
|
|
colorLabel.setPreferredSize(new Dimension(21, 21));
|
|
|
|
|
|
|
|
|
|
colorLabel.setOpaque(true);
|
|
|
|
|
@ -200,7 +196,7 @@ private void initColorLabel()
|
|
|
|
|
|
|
|
|
|
colorLabel.addMouseListener(new MouseAdapter()
|
|
|
|
|
{
|
|
|
|
|
public void mousePressed(MouseEvent arg0)
|
|
|
|
|
public void mousePressed(MouseEvent event)
|
|
|
|
|
{
|
|
|
|
|
Color newColor =
|
|
|
|
|
JColorChooser.showDialog(new JColorChooser(),
|
|
|
|
|
@ -303,12 +299,17 @@ private JToggleButton initStyleToggleButton(final Action action,
|
|
|
|
|
{
|
|
|
|
|
final JToggleButton button = new JToggleButton();
|
|
|
|
|
button.setPreferredSize(new Dimension(25, 25));
|
|
|
|
|
|
|
|
|
|
button.setName(styleConstant.toString());
|
|
|
|
|
button.addActionListener(new ActionListener()
|
|
|
|
|
{
|
|
|
|
|
public void actionPerformed(ActionEvent e)
|
|
|
|
|
{
|
|
|
|
|
action.actionPerformed(e);
|
|
|
|
|
ActionEvent event = new ActionEvent(chatEditorPane,
|
|
|
|
|
ActionEvent.ACTION_PERFORMED,
|
|
|
|
|
styleConstant.toString());
|
|
|
|
|
|
|
|
|
|
action.actionPerformed(event);
|
|
|
|
|
|
|
|
|
|
chatEditorPane.requestFocus();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -341,6 +342,7 @@ public void mouseClicked(MouseEvent e)
|
|
|
|
|
selectButton(styleConstant, button);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return button;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|