This is an automated email from the git hooks/post-receive script. fnatter-guest pushed a commit to branch master in repository jajuk.
commit 63cf6939d60f791c5721ae45e0a2948774f35438 Author: Felix Natter <[email protected]> Date: Sat Apr 9 14:02:38 2016 +0200 Imported Upstream version 1.10.9+dfsg2 --- src/main/java/ext/JScrollingText.java | 127 ---- .../ext/scrollablepopupmenu/XCheckedButton.java | 257 -------- .../java/ext/scrollablepopupmenu/XJPopupMenu.java | 221 ------- src/main/java/ext/scrollablepopupmenu/package.html | 7 - src/scripts/nsisant-1.3.jar | Bin 4402 -> 0 bytes src/test/java/ext/TestJScrollingText.java | 672 --------------------- .../scrollablepopupmenu/TestXCheckedButton.java | 232 ------- .../ext/scrollablepopupmenu/TestXJPopupMenu.java | 142 ----- 8 files changed, 1658 deletions(-) diff --git a/src/main/java/ext/JScrollingText.java b/src/main/java/ext/JScrollingText.java deleted file mode 100644 index 5d5ebfa..0000000 --- a/src/main/java/ext/JScrollingText.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Scrolling text component Code found at - * http://www.developpez.net/forums/archive/index.php/t-41622.html Thanks - * "herve91" - */ -package ext; - -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Insets; -import java.util.Timer; -import java.util.TimerTask; - -import javax.swing.JLabel; - -/** - * . - */ -public class JScrollingText extends JLabel { - /** Generated serialVersionUID. */ - private static final long serialVersionUID = 3068213731703270035L; - private final int speed; - private final int period; - private final int offset; - private int x = 300; - - /** - * Instantiates a new j scrolling text. - * - * @param text - */ - public JScrollingText(String text) { - this(text, 1); - } - - /** - * Instantiates a new j scrolling text. - * - * @param text - * @param speed - */ - public JScrollingText(String text, int speed) { - this(text, speed, 100); - } - - /** - * Instantiates a new j scrolling text. - * - * @param text - * @param speed - * @param period - */ - public JScrollingText(String text, int speed, int period) { - this(text, speed, period, 0); - } - - /** - * Instantiates a new j scrolling text. - * - * @param text - * @param speed - * @param period - * @param offset - */ - public JScrollingText(String text, int speed, int period, int offset) { - super(text); - this.speed = speed; - this.period = period; - this.offset = offset; - } - - /* (non-Javadoc) - * @see javax.swing.JComponent#paintComponent(java.awt.Graphics) - */ - @Override - public void paintComponent(Graphics g) { - if (isOpaque()) { - g.setColor(getBackground()); - g.fillRect(0, 0, getWidth(), getHeight()); - } - g.setColor(getForeground()); - FontMetrics fm = g.getFontMetrics(); - Insets insets = getInsets(); - int width = getWidth() - (insets.left + insets.right); - int height = getHeight() - (insets.top + insets.bottom); - int textWidth = fm.stringWidth(getText()); - if (width < textWidth) { - width = textWidth + offset; - } - x %= width; - int textX = insets.left + x; - int textY = insets.top + (height - fm.getHeight()) / 2 + fm.getAscent(); - g.drawString(getText(), textX, textY); - g.drawString(getText(), textX + (speed > 0 ? -width : width), textY); - } - - Timer timer; - - /** - * Start. - * - */ - public void start() { - timer = new Timer("Scrolling Text Timer"); - TimerTask task = new TimerTask() { - @Override - public void run() { - x += speed; - repaint(); - } - }; - timer.scheduleAtFixedRate(task, 1000, period); - } - - /* (non-Javadoc) - * @see javax.swing.JComponent#removeNotify() - */ - @Override - public void removeNotify() { - // clean out the timer - if (timer != null) { - timer.cancel(); - timer = null; - } - super.removeNotify(); - } -} diff --git a/src/main/java/ext/scrollablepopupmenu/XCheckedButton.java b/src/main/java/ext/scrollablepopupmenu/XCheckedButton.java deleted file mode 100644 index 6f99259..0000000 --- a/src/main/java/ext/scrollablepopupmenu/XCheckedButton.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright balajihe from - * http://www.beginner-java-tutorial.com/scrollable-jpopupmenu.html - * - */ -package ext.scrollablepopupmenu; - -import java.awt.Color; -import java.awt.event.ItemEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JToggleButton; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicButtonUI; - -import org.jajuk.util.IconLoader; -import org.jajuk.util.JajukIcons; - -/** - * The Class XCheckedButton. - * - * @author balajihe from - * http://www.beginner-java-tutorial.com/scrollable-jpopupmenu.html - */ -public class XCheckedButton extends JButton { - /** Generated serialVersionUID. */ - private static final long serialVersionUID = 6665536733427576873L; - // Icon to be used to for the Checked Icon of the Button - private ImageIcon checkedIcon; - /** Requires the icon to be always displayed, even when the item is unselected. */ - private boolean iconAlwaysVisible = false; - /** These colors are required in order to simulate the JMenuItem's L&F. */ - public static final Color MENU_HIGHLIGHT_BG_COLOR = UIManager - .getColor("MenuItem.selectionBackground"); - /** The Constant MENU_HIGHLIGHT_FG_COLOR. */ - public static final Color MENU_HIGHLIGHT_FG_COLOR = UIManager - .getColor("MenuItem.selectionForeground"); - /** The Constant MENUITEM_BG_COLOR. */ - public static final Color MENUITEM_BG_COLOR = UIManager.getColor("MenuItem.background"); - /** The Constant MENUITEM_FG_COLOR. */ - public static final Color MENUITEM_FG_COLOR = UIManager.getColor("MenuItem.foreground"); - // This property if set to false, will result in the checked Icon not being - // displayed - // when the button is selected - private boolean displayCheck = true; - - /** - * Instantiates a new x checked button. - */ - public XCheckedButton() { - super(); - init(); - } - - /** - * Instantiates a new x checked button. - * - * @param a - */ - public XCheckedButton(Action a) { - super(a); - init(); - } - - /** - * Instantiates a new x checked button. - * - * @param icon - */ - public XCheckedButton(Icon icon) { - super(icon); - init(); - } - - /** - * Instantiates a new x checked button. - * - * @param text - * @param icon - */ - public XCheckedButton(String text, Icon icon) { - super(text, icon); - init(); - } - - /** - * Instantiates a new x checked button. - * - * @param text - */ - public XCheckedButton(String text) { - super(text); - init(); - } - - /** - * Initialize component LAF and add Listeners. - */ - private void init() { - MouseAdapter mouseAdapter = getMouseAdapter(); - // Basically JGoodies LAF UI for JButton does not allow Background color - // to be set. - // So we need to set the default UI, - ComponentUI ui = BasicButtonUI.createUI(this); - this.setUI(ui); - setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 2)); - setMenuItemDefaultColors(); - // setContentAreaFilled(false); - setHorizontalTextPosition(SwingConstants.RIGHT); - setHorizontalAlignment(SwingConstants.LEFT); - // setModel(new JToggleButton.ToggleButtonModel()); - setModel(new XCheckedButtonModel()); - setSelected(false); - this.addMouseListener(mouseAdapter); - } - - /** - * Sets the menu item default colors. - * - */ - private void setMenuItemDefaultColors() { - XCheckedButton.this.setBackground(MENUITEM_BG_COLOR); - XCheckedButton.this.setForeground(MENUITEM_FG_COLOR); - } - - /** - * Gets the mouse adapter. - * - * @return the mouse adapter - */ - private MouseAdapter getMouseAdapter() { - return new MouseAdapter() { - // For static menuitems, the background color remains the - // highlighted color, if this is not overridden - @Override - public void mousePressed(MouseEvent e) { - setMenuItemDefaultColors(); - } - - @Override - public void mouseEntered(MouseEvent e) { - XCheckedButton.this.setBackground(MENU_HIGHLIGHT_BG_COLOR); - XCheckedButton.this.setForeground(MENU_HIGHLIGHT_FG_COLOR); - } - - @Override - public void mouseExited(MouseEvent e) { - setMenuItemDefaultColors(); - } - }; - } - - /** - * Display icon. - * - * @param checkedFlag - */ - public void displayIcon(boolean checkedFlag) { - if (checkedFlag && isDisplayCheck()) { - if (checkedIcon == null) { - checkedIcon = IconLoader.getIcon(JajukIcons.OK); - } - this.setIcon(checkedIcon); - } else { - this.setIcon(IconLoader.getIcon(JajukIcons.EMPTY)); - } - this.repaint(); - } - - /** - * . - */ - private class XCheckedButtonModel extends JToggleButton.ToggleButtonModel { - /** Generated serialVersionUID. */ - private static final long serialVersionUID = 4628990599914525833L; - - /* - * Need to Override keeping the super code, else the check mark won't come - */ - /* (non-Javadoc) - * @see javax.swing.JToggleButton.ToggleButtonModel#setSelected(boolean) - */ - @Override - public void setSelected(final boolean b) { - boolean set = b; - ButtonGroup group = getGroup(); - if (group != null) { - // use the group model instead - group.setSelected(this, set); - set = group.isSelected(this); - } - if (isSelected() == set) { - return; - } - if (set) { - stateMask |= SELECTED; - } else { - stateMask &= ~SELECTED; - } - // Send ChangeEvent - fireStateChanged(); - // Send ItemEvent - fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, - this.isSelected() ? ItemEvent.SELECTED : ItemEvent.DESELECTED)); - XCheckedButton.this.displayIcon(set | iconAlwaysVisible); - } - } - - // Returns true if Button will display Checked Icon on Click. Default - // Behaviour is to display a Checked Icon - /** - * Checks if is display check. - * - * @return true, if is display check - */ - public boolean isDisplayCheck() { - return displayCheck; - } - - /** - * Sets the property which determines whether a checked Icon should be - * displayed or not Setting to false, makes this button display like a normal - * button. - * - * @param displayCheck - */ - public void setDisplayCheck(boolean displayCheck) { - this.displayCheck = displayCheck; - } - - /** - * Sets the checked icon. - * - * @param checkedIcon the new checked icon - */ - public void setCheckedIcon(ImageIcon checkedIcon) { - this.checkedIcon = checkedIcon; - } - - /** - * Sets the icon always visible. - * - * @param iconAlwaysVisible the new icon always visible - */ - public void setIconAlwaysVisible(boolean iconAlwaysVisible) { - this.iconAlwaysVisible = iconAlwaysVisible; - } -} diff --git a/src/main/java/ext/scrollablepopupmenu/XJPopupMenu.java b/src/main/java/ext/scrollablepopupmenu/XJPopupMenu.java deleted file mode 100644 index 244f394..0000000 --- a/src/main/java/ext/scrollablepopupmenu/XJPopupMenu.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * This class implements a scrollable Popup Menu - * - * Copyright balajihe from - * http://www.beginner-java-tutorial.com/scrollable-jpopupmenu.html - * - */ -package ext.scrollablepopupmenu; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.GridLayout; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.AbstractButton; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicSeparatorUI; - -/** - * This class implements a scrollable Popup Menu. - * - * @author balajihe from - * http://www.beginner-java-tutorial.com/scrollable-jpopupmenu.html - */ -public class XJPopupMenu extends JPopupMenu implements ActionListener { - /** Generated serialVersionUID. */ - private static final long serialVersionUID = 1; - private final JPanel panelMenus = new JPanel(); - private JScrollPane scroll = null; - private JFrame jframe = null; - /** The Constant EMPTY_IMAGE_ICON. */ - public static final Icon EMPTY_IMAGE_ICON = new ImageIcon("menu_spacer.gif"); - - /** - * Instantiates a new xJ popup menu. - * - * @param jframe - */ - public XJPopupMenu(JFrame jframe) { - super(); - this.jframe = jframe; - this.setLayout(new BorderLayout()); - panelMenus.setLayout(new GridLayout(0, 1)); - panelMenus.setBackground(UIManager.getColor("MenuItem.background")); - // panelMenus.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); - init(); - } - - /** - * Inits the. - * - */ - public void init() { - super.removeAll(); - scroll = new JScrollPane(); - scroll.setViewportView(panelMenus); - scroll.setBorder(null); - scroll.setMinimumSize(new Dimension(240, 40)); - scroll.setMaximumSize(new Dimension(scroll.getMaximumSize().width, this.getToolkit() - .getScreenSize().height - - this.getToolkit().getScreenInsets(jframe.getGraphicsConfiguration()).top - - this.getToolkit().getScreenInsets(jframe.getGraphicsConfiguration()).bottom - 4)); - super.add(scroll, BorderLayout.CENTER); - } - - /* (non-Javadoc) - * @see javax.swing.JPopupMenu#show(java.awt.Component, int, int) - */ - @Override - public void show(Component invoker, int x, int y) { - init(); - panelMenus.validate(); - int maxsize = scroll.getMaximumSize().height; - int realsize = panelMenus.getPreferredSize().height; - int sizescroll = 0; - if (maxsize < realsize) { - sizescroll = scroll.getVerticalScrollBar().getPreferredSize().width; - } - scroll.setPreferredSize(new Dimension(scroll.getPreferredSize().width + sizescroll + 20, scroll - .getPreferredSize().height)); - this.pack(); - this.setInvoker(invoker); - if (sizescroll != 0) { - // Set popup size only if scrollbar is visible - this.setPopupSize(new Dimension(scroll.getPreferredSize().width + 20, - scroll.getMaximumSize().height - 20)); - } - // this.setMaximumSize(scroll.getMaximumSize()); - Point invokerOrigin = invoker.getLocationOnScreen(); - this.setLocation((int) invokerOrigin.getX() + x, (int) invokerOrigin.getY() + y); - this.setVisible(true); - } - - /** - * Hidemenu. - * - */ - public void hidemenu() { - if (this.isVisible()) { - this.setVisible(false); - } - } - - /** - * Adds the. - * - * - * @param menuItem - */ - public void add(AbstractButton menuItem) { - // menuItem.setMargin(new Insets(0, 20, 0 , 0)); - if (menuItem == null) { - return; - } - panelMenus.add(menuItem); - menuItem.removeActionListener(this); - menuItem.addActionListener(this); - if (menuItem.getIcon() == null) { - menuItem.setIcon(EMPTY_IMAGE_ICON); - } - } - - /* (non-Javadoc) - * @see javax.swing.JPopupMenu#addSeparator() - */ - @Override - public void addSeparator() { - panelMenus.add(new XSeperator()); - } - - /* (non-Javadoc) - * @see java.awt.Container#removeAll() - */ - @Override - public void removeAll() { - panelMenus.removeAll(); - } - - /* (non-Javadoc) - * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - */ - @Override - public void actionPerformed(ActionEvent e) { - this.hidemenu(); - } - - /* (non-Javadoc) - * @see java.awt.Container#getComponents() - */ - @Override - public Component[] getComponents() { - return panelMenus.getComponents(); - } - - /** - * . - */ - private static class XSeperator extends JSeparator { - /** Generated serialVersionUID. */ - private static final long serialVersionUID = -6249719411021239596L; - - /** - * Instantiates a new x seperator. - */ - XSeperator() { - ComponentUI ui = XBasicSeparatorUI.createUI(this); - XSeperator.this.setUI(ui); - } - - /** - * . - */ - private static class XBasicSeparatorUI extends BasicSeparatorUI { - /** - * Creates the ui. - * - * - * @param c - * - * @return the component ui - */ - public static ComponentUI createUI(JComponent c) { - return new XBasicSeparatorUI(); - } - - /* (non-Javadoc) - * @see javax.swing.plaf.basic.BasicSeparatorUI#paint(java.awt.Graphics, javax.swing.JComponent) - */ - @Override - public void paint(Graphics g, JComponent c) { - Dimension s = c.getSize(); - if (((JSeparator) c).getOrientation() == SwingConstants.VERTICAL) { - g.setColor(c.getForeground()); - g.drawLine(0, 0, 0, s.height); - g.setColor(c.getBackground()); - g.drawLine(1, 0, 1, s.height); - } else // HORIZONTAL - { - g.setColor(c.getForeground()); - g.drawLine(0, 7, s.width, 7); - g.setColor(c.getBackground()); - g.drawLine(0, 8, s.width, 8); - } - } - } - } -} diff --git a/src/main/java/ext/scrollablepopupmenu/package.html b/src/main/java/ext/scrollablepopupmenu/package.html deleted file mode 100644 index 925e1a3..0000000 --- a/src/main/java/ext/scrollablepopupmenu/package.html +++ /dev/null @@ -1,7 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head></head> -<body> - -</body> -</html> \ No newline at end of file diff --git a/src/scripts/nsisant-1.3.jar b/src/scripts/nsisant-1.3.jar deleted file mode 100755 index b85c89a..0000000 Binary files a/src/scripts/nsisant-1.3.jar and /dev/null differ diff --git a/src/test/java/ext/TestJScrollingText.java b/src/test/java/ext/TestJScrollingText.java deleted file mode 100644 index c43441b..0000000 --- a/src/test/java/ext/TestJScrollingText.java +++ /dev/null @@ -1,672 +0,0 @@ -/* - * Jajuk - * Copyright (C) The Jajuk Team - * http://jajuk.info - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -package ext; - -import java.awt.Color; -import java.awt.Composite; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GraphicsConfiguration; -import java.awt.Image; -import java.awt.Paint; -import java.awt.Rectangle; -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; -import java.awt.Shape; -import java.awt.Stroke; -import java.awt.font.FontRenderContext; -import java.awt.font.GlyphVector; -import java.awt.geom.AffineTransform; -import java.awt.image.BufferedImage; -import java.awt.image.BufferedImageOp; -import java.awt.image.ImageObserver; -import java.awt.image.RenderedImage; -import java.awt.image.renderable.RenderableImage; -import java.text.AttributedCharacterIterator; -import java.util.Map; - -import junit.framework.TestCase; - -/** - * . - */ -public class TestJScrollingText extends TestCase { - /** - * Test method for {@link ext.JScrollingText#JScrollingText(String)}. - */ - public void testJScrollingTextString() { - new JScrollingText("teststring"); - } - - /** - * Test method for {@link ext.JScrollingText#JScrollingText(String, int)}. - */ - public void testJScrollingTextStringInt() { - new JScrollingText("teststring", 1000); - } - - /** - * Test method for {@link ext.JScrollingText#JScrollingText(String, int, int)} - * . - */ - public void testJScrollingTextStringIntInt() { - new JScrollingText("teststring", 500, 1000); - } - - /** - * Test method for. - * - * {@link ext.JScrollingText#JScrollingText(String, int, int, int)}. - */ - public void testJScrollingTextStringIntIntInt() { - new JScrollingText("teststring", 700, 100, 10); - } - - /** - * Test method for {@link ext.JScrollingText#paintComponent(Graphics)}. - */ - public void testPaintComponent() { - JScrollingText t = new JScrollingText("teststring"); - assertNotNull(t); - t.paintComponent(new MyGraphics2D()); - } - - /** - * Test paint component opaque. - * - */ - public void testPaintComponentOpaque() { - JScrollingText t = new JScrollingText("teststring"); - t.setOpaque(true); - t.paintComponent(new MyGraphics2D()); - } - - /** - * Test paint component speed. - * - */ - public void testPaintComponentSpeed() { - JScrollingText t = new JScrollingText("teststring", 1000); - t.paintComponent(new MyGraphics2D()); - } - - /** - * Test paint component speed zero. - * - */ - public void testPaintComponentSpeedZero() { - JScrollingText t = new JScrollingText("teststring", 0); - t.paintComponent(new MyGraphics2D()); - } - - /** - * Test method for {@link ext.JScrollingText#start()}. - * - * @throws Exception the exception - */ - public void testStart() throws Exception { - JScrollingText t = new JScrollingText("teststring"); - assertNotNull(t); - t.start(); - // have to sleep some time here to make the Timer run at least once - Thread.sleep(1100); - } - - /** - * . - */ - private final class MyGraphics2D extends Graphics2D { - /* (non-Javadoc) - * @see java.awt.Graphics#setXORMode(java.awt.Color) - */ - @Override - public void setXORMode(Color c1) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#setPaintMode() - */ - @Override - public void setPaintMode() { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#setFont(java.awt.Font) - */ - @Override - public void setFont(Font font) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#setColor(java.awt.Color) - */ - @Override - public void setColor(Color c) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#setClip(int, int, int, int) - */ - @Override - public void setClip(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#setClip(java.awt.Shape) - */ - @Override - public void setClip(Shape clip) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#getFontMetrics(java.awt.Font) - */ - @Override - public FontMetrics getFontMetrics(Font f) { - return new FontMetrics(f) { - private static final long serialVersionUID = 9139781111511738969L; - - @Override - public int stringWidth(String str) { - return str.length(); - } - - @Override - public int getHeight() { - return 10; - } - - @Override - public int getAscent() { - return 10; - } - }; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#getFont() - */ - @Override - public Font getFont() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#getColor() - */ - @Override - public Color getColor() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#getClipBounds() - */ - @Override - public Rectangle getClipBounds() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#getClip() - */ - @Override - public Shape getClip() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#fillRoundRect(int, int, int, int, int, int) - */ - @Override - public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#fillRect(int, int, int, int) - */ - @Override - public void fillRect(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#fillPolygon(int[], int[], int) - */ - @Override - public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#fillOval(int, int, int, int) - */ - @Override - public void fillOval(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#fillArc(int, int, int, int, int, int) - */ - @Override - public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawRoundRect(int, int, int, int, int, int) - */ - @Override - public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawPolyline(int[], int[], int) - */ - @Override - public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawPolygon(int[], int[], int) - */ - @Override - public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawOval(int, int, int, int) - */ - @Override - public void drawOval(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawLine(int, int, int, int) - */ - @Override - public void drawLine(int x1, int y1, int x2, int y2) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, int, int, int, int, int, int, java.awt.Color, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, - int sx2, int sy2, Color bgcolor, ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, int, int, int, int, int, int, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, - int sx2, int sy2, ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.Color, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, - ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, java.awt.Color, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#drawArc(int, int, int, int, int, int) - */ - @Override - public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#dispose() - */ - @Override - public void dispose() { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#create() - */ - @Override - public Graphics create() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics#copyArea(int, int, int, int, int, int) - */ - @Override - public void copyArea(int x, int y, int width, int height, int dx, int dy) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#clipRect(int, int, int, int) - */ - @Override - public void clipRect(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics#clearRect(int, int, int, int) - */ - @Override - public void clearRect(int x, int y, int width, int height) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#translate(double, double) - */ - @Override - public void translate(double tx, double ty) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#translate(int, int) - */ - @Override - public void translate(int x, int y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#transform(java.awt.geom.AffineTransform) - */ - @Override - public void transform(AffineTransform Tx) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#shear(double, double) - */ - @Override - public void shear(double shx, double shy) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setTransform(java.awt.geom.AffineTransform) - */ - @Override - public void setTransform(AffineTransform Tx) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setStroke(java.awt.Stroke) - */ - @Override - public void setStroke(Stroke s) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setRenderingHints(java.util.Map) - */ - @Override - public void setRenderingHints(Map<?, ?> hints) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object) - */ - @Override - public void setRenderingHint(Key hintKey, Object hintValue) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setPaint(java.awt.Paint) - */ - @Override - public void setPaint(Paint paint) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setComposite(java.awt.Composite) - */ - @Override - public void setComposite(Composite comp) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#setBackground(java.awt.Color) - */ - @Override - public void setBackground(Color color) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#scale(double, double) - */ - @Override - public void scale(double sx, double sy) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#rotate(double, double, double) - */ - @Override - public void rotate(double theta, double x, double y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#rotate(double) - */ - @Override - public void rotate(double theta) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#hit(java.awt.Rectangle, java.awt.Shape, boolean) - */ - @Override - public boolean hit(Rectangle rect, Shape s, boolean onStroke) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getTransform() - */ - @Override - public AffineTransform getTransform() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getStroke() - */ - @Override - public Stroke getStroke() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getRenderingHints() - */ - @Override - public RenderingHints getRenderingHints() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getRenderingHint(java.awt.RenderingHints.Key) - */ - @Override - public Object getRenderingHint(Key hintKey) { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getPaint() - */ - @Override - public Paint getPaint() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getFontRenderContext() - */ - @Override - public FontRenderContext getFontRenderContext() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getDeviceConfiguration() - */ - @Override - public GraphicsConfiguration getDeviceConfiguration() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getComposite() - */ - @Override - public Composite getComposite() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#getBackground() - */ - @Override - public Color getBackground() { - return null; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#fill(java.awt.Shape) - */ - @Override - public void fill(Shape s) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float) - */ - @Override - public void drawString(AttributedCharacterIterator iterator, float x, float y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, int, int) - */ - @Override - public void drawString(AttributedCharacterIterator iterator, int x, int y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawString(java.lang.String, float, float) - */ - @Override - public void drawString(String str, float x, float y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawString(java.lang.String, int, int) - */ - @Override - public void drawString(String str, int x, int y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawRenderedImage(java.awt.image.RenderedImage, java.awt.geom.AffineTransform) - */ - @Override - public void drawRenderedImage(RenderedImage img, AffineTransform xform) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawRenderableImage(java.awt.image.renderable.RenderableImage, java.awt.geom.AffineTransform) - */ - @Override - public void drawRenderableImage(RenderableImage img, AffineTransform xform) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawImage(java.awt.image.BufferedImage, java.awt.image.BufferedImageOp, int, int) - */ - @Override - public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawImage(java.awt.Image, java.awt.geom.AffineTransform, java.awt.image.ImageObserver) - */ - @Override - public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { - return false; - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#drawGlyphVector(java.awt.font.GlyphVector, float, float) - */ - @Override - public void drawGlyphVector(GlyphVector g, float x, float y) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#draw(java.awt.Shape) - */ - @Override - public void draw(Shape s) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#clip(java.awt.Shape) - */ - @Override - public void clip(Shape s) { - } - - /* (non-Javadoc) - * @see java.awt.Graphics2D#addRenderingHints(java.util.Map) - */ - @Override - public void addRenderingHints(Map<?, ?> hints) { - } - } -} diff --git a/src/test/java/ext/scrollablepopupmenu/TestXCheckedButton.java b/src/test/java/ext/scrollablepopupmenu/TestXCheckedButton.java deleted file mode 100644 index 9887776..0000000 --- a/src/test/java/ext/scrollablepopupmenu/TestXCheckedButton.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Jajuk - * Copyright (C) The Jajuk Team - * http://jajuk.info - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -package ext.scrollablepopupmenu; - -import java.awt.Component; -import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.beans.PropertyChangeListener; - -import javax.swing.Action; -import javax.swing.ButtonGroup; -import javax.swing.DefaultButtonModel; -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import junit.framework.TestCase; - -import org.apache.commons.lang.ArrayUtils; - -/** - * . - */ -public class TestXCheckedButton extends TestCase { - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#XCheckedButton()}. - */ - public final void testXCheckedButton() { - new XCheckedButton(); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#XCheckedButton(javax.swing.Action)} - * . - */ - public final void testXCheckedButtonAction() { - new XCheckedButton(new Action() { - @Override - public void addPropertyChangeListener(PropertyChangeListener listener) { - } - - @Override - public Object getValue(String key) { - return null; - } - - @Override - public boolean isEnabled() { - return false; - } - - @Override - public void putValue(String key, Object value) { - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener listener) { - } - - @Override - public void setEnabled(boolean b) { - } - - @Override - public void actionPerformed(ActionEvent e) { - } - }); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#XCheckedButton(javax.swing.Icon)} - * . - */ - public final void testXCheckedButtonIcon() { - new XCheckedButton(new DummyIcon()); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#XCheckedButton(java.lang.String, javax.swing.Icon)} - * . - */ - public final void testXCheckedButtonStringIcon() { - new XCheckedButton("testtext", new DummyIcon()); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#XCheckedButton(java.lang.String)} - * . - */ - public final void testXCheckedButtonString() { - new XCheckedButton("testtext"); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#displayIcon(boolean)}. - */ - public final void testDisplayIcon() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - button.displayIcon(false); - button.displayIcon(true); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#isDisplayCheck()}. - */ - public final void testIsAndSetDisplayCheck() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - assertTrue(button.isDisplayCheck()); - button.setDisplayCheck(false); - assertFalse(button.isDisplayCheck()); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#setDisplayCheck(boolean)}. - */ - public final void testSetDisplayCheck() { - // tested above - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#setCheckedIcon(javax.swing.ImageIcon)} - * . - */ - public final void testSetCheckedIcon() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - button.setCheckedIcon(new ImageIcon()); - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XCheckedButton#setIconAlwaysVisible(boolean)} - * . - */ - public final void testSetIconAlwaysVisible() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - button.setIconAlwaysVisible(true); - button.setIconAlwaysVisible(false); - } - - /** - * . - */ - public class DummyIcon implements Icon { - /* (non-Javadoc) - * @see javax.swing.Icon#getIconHeight() - */ - @Override - public int getIconHeight() { - return 0; - } - - /* (non-Javadoc) - * @see javax.swing.Icon#getIconWidth() - */ - @Override - public int getIconWidth() { - return 0; - } - - /* (non-Javadoc) - * @see javax.swing.Icon#paintIcon(java.awt.Component, java.awt.Graphics, int, int) - */ - @Override - public void paintIcon(Component c, Graphics g, int x, int y) { - } - } - - /** - * Test mouse adapter. - * - */ - public void testMouseAdapter() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - // we should have at least one a mouse listener on the button - assertTrue(ArrayUtils.toString(button.getMouseListeners()), - button.getMouseListeners().length > 0); - // none of them looks at the actual event right now... - button.getMouseListeners()[1].mousePressed(null); - button.getMouseListeners()[1].mouseEntered(null); - button.getMouseListeners()[1].mouseExited(null); - } - - /** - * Test model. - * - */ - public void testModel() { - XCheckedButton button = new XCheckedButton("testtext", new DummyIcon()); - assertNotNull(button.getModel()); - button.setSelected(true); - button.setSelected(false); - ((DefaultButtonModel) button.getModel()).setGroup(new ButtonGroup()); - button.setSelected(true); - button.setSelected(false); - } -} diff --git a/src/test/java/ext/scrollablepopupmenu/TestXJPopupMenu.java b/src/test/java/ext/scrollablepopupmenu/TestXJPopupMenu.java deleted file mode 100644 index df66ab8..0000000 --- a/src/test/java/ext/scrollablepopupmenu/TestXJPopupMenu.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Jajuk - * Copyright (C) The Jajuk Team - * http://jajuk.info - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -package ext.scrollablepopupmenu; - -import java.awt.HeadlessException; - -import javax.swing.AbstractButton; - -import junit.framework.TestCase; - -/** - * . - */ -public class TestXJPopupMenu extends TestCase { - /** - * Test method for {@link ext.scrollablepopupmenu.XJPopupMenu#removeAll()}. - */ - public void testRemoveAll() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.removeAll(); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for {@link ext.scrollablepopupmenu.XJPopupMenu#addSeparator()}. - */ - public void testAddSeparator() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.addSeparator(); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XJPopupMenu#XJPopupMenu(javax.swing.JFrame)} - * . - */ - public void testXJPopupMenu() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - assertNotNull(menu); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XJPopupMenu#show(java.awt.Component, int, int)} - * . - */ - public void testShowComponentIntInt() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.show(null, 0, 0); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for {@link ext.scrollablepopupmenu.XJPopupMenu#hidemenu()}. - */ - public void testHidemenu() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.hidemenu(); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XJPopupMenu#add(javax.swing.AbstractButton)} - * . - */ - public void testAddAbstractButton() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - AbstractButton button = null; - menu.add(button); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for. - * - * {@link ext.scrollablepopupmenu.XJPopupMenu#actionPerformed(java.awt.event.ActionEvent)} - * . - */ - public void testActionPerformed() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.actionPerformed(null); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } - - /** - * Test method for {@link ext.scrollablepopupmenu.XJPopupMenu#getComponents()} - * . - */ - public void testGetComponents() { - try { - XJPopupMenu menu = new XJPopupMenu(null); - menu.getComponents(); - } catch (HeadlessException e) { - // happens if run without GUI support - } - } -} -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jajuk.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

