Search in sources :

Example 1 with MouseClickListener

use of main.swing.generic.services.listener.MouseClickListener in project Eidolons by IDemiurge.

the class G_ScrolledPanel method addArrows.

protected void addArrows(final boolean forward) {
    String y;
    String x;
    // if (forward) {
    y = vertical ? "" + spaceTaken : "center_y@";
    x = !vertical ? "" + spaceTaken : "center_x@";
    // } else {
    // y = vertical ? "0" : "center_y@";
    // x = !vertical ? "0" : "center_x@";
    // }
    String pos = "pos " + x + " " + y;
    GraphicComponent arrow = new GraphicComponent(getArrowImage(forward));
    arrow.addMouseListener(new MouseClickListener() {

        public void mouseClicked(MouseEvent arg0) {
            arrowPressed(forward);
        }
    });
    add(arrow, pos);
    spaceTaken += (vertical ? getArrowImage(true).getHeight(null) : getArrowImage(true).getWidth(null));
}
Also used : MouseClickListener(main.swing.generic.services.listener.MouseClickListener) GraphicComponent(main.swing.generic.components.misc.GraphicComponent) MouseEvent(java.awt.event.MouseEvent)

Example 2 with MouseClickListener

use of main.swing.generic.services.listener.MouseClickListener in project Eidolons by IDemiurge.

the class G_TabbedPagePanel method createTab.

protected Component createTab(E sub, final int i) {
    TextComp textComp = new TextComp(sub.toString(), Color.black) {

        @Override
        public int getBorderWidth() {
            return 1;
        }

        @Override
        public Color getBorderColor() {
            return currentIndex == i ? ColorManager.ESSENCE : super.getBorderColor();
        }

        @Override
        public int getPanelHeight() {
            return super.getPanelHeight() * 2 / 3;
        }
    };
    // textComp.getde
    textComp.addMouseListener(new MouseClickListener() {

        @Override
        public void mouseClicked(MouseEvent arg0) {
            tabClicked(i);
        }
    });
    return textComp;
}
Also used : MouseClickListener(main.swing.generic.services.listener.MouseClickListener) MouseEvent(java.awt.event.MouseEvent) TextComp(main.swing.components.TextComp)

Aggregations

MouseEvent (java.awt.event.MouseEvent)2 MouseClickListener (main.swing.generic.services.listener.MouseClickListener)2 TextComp (main.swing.components.TextComp)1 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)1