Package com.alee.extended.painter

Examples of com.alee.extended.painter.Painter


    @Override
    public Component getPreview ( WebLookAndFeelDemo owner )
    {
        // Custom button painter
        // This painter only changes view on button focus and disabled state changes
        Painter painter = new SeaGlassButtonPainter ();

        // Simple button to demostrate painter in action
        WebButton button1 = new WebButton ( "Simple" );
        button1.setPainter ( painter );
        button1.setMoveIconOnPress ( false );
View Full Code Here


                // Painter ID
                final String painterId = painterStyle.getId ();

                // Retrieving painter to install into component
                // Custom painter can be null - that will just mean that component should not have painter installed
                final Painter painter;
                if ( customPainters != null && customPainters.containsKey ( painterId ) )
                {
                    // Using provided custom painter
                    // This might be set using Web-component "set...Painter"-like methods
                    painter = customPainters.get ( painterId );
View Full Code Here

     * @param <T>       style property value type
     * @return style property value
     */
    public <T> T getPainterPropertyValue ( final JComponent component, final String painterId, final String key )
    {
        final Painter painter = getPainter ( component, painterId );
        if ( painter != null )
        {
            // Retrieving painter field value
            return getFieldValue ( painter, key );
        }
View Full Code Here

     * @param value     custom style property value
     * @return true if custom style property was applied, false otherwise
     */
    public boolean setCustomPainterProperty ( final JComponent component, final String painterId, final String key, final Object value )
    {
        final Painter painter = getPainter ( component, painterId );
        if ( painter != null )
        {
            // Updating painter field with custom style property value
            return setFieldValue ( painter, key, value );
        }
View Full Code Here

        // Tab background
        final GeneralPath bgShape = createTabShape ( TabShapeType.background, tabPlacement, x, y, w, h, isSelected );
        if ( backgroundPainterAt.containsKey ( tabIndex ) && isSelected )
        {
            final Shape old = GraphicsUtils.intersectClip ( g2d, bgShape );
            final Painter bp = backgroundPainterAt.get ( tabIndex );
            bp.paint ( g2d, new Rectangle ( x, y, w, h ), tabPane );
            GraphicsUtils.restoreClip ( g2d, old );
        }
        else
        {
            final Point topPoint = getTopTabBgPoint ( tabPlacement, x, y, w, h );
View Full Code Here

        final StyledLabelPainter properPainter =
                LafUtils.getProperPainter ( painter, StyledLabelPainter.class, AdaptiveStyledLabelPainter.class );

        // Properly updating painter
        PainterSupport.uninstallPainter ( label, this.painter );
        final Painter oldPainter = this.painter;
        this.painter = properPainter;
        applyPainterSettings ( properPainter );
        PainterSupport.installPainter ( label, properPainter );

        // Firing painter change event
View Full Code Here

    public Dimension getPreferredSize ()
    {
        Dimension ps = SizeUtils.getPreferredSize ( this, super.getPreferredSize () );

        // Fix to take painter preferres size into account
        final Painter painter = getPainter ();
        if ( painter != null )
        {
            ps = SwingUtils.max ( ps, painter.getPreferredSize ( this ) );
        }

        return ps;
    }
View Full Code Here

        final ScrollBarPainter properPainter =
                LafUtils.getProperPainter ( painter, ScrollBarPainter.class, AdaptiveScrollBarPainter.class );

        // Properly updating painter
        PainterSupport.uninstallPainter ( scrollbar, this.painter );
        final Painter oldPainter = this.painter;
        this.painter = properPainter;
        applyPainterSettings ( properPainter );
        PainterSupport.installPainter ( scrollbar, properPainter );

        // Firing painter change event
View Full Code Here

        final PopupMenuPainter properPainter =
                LafUtils.getProperPainter ( painter, PopupMenuPainter.class, AdaptivePopupMenuPainter.class );

        // Properly updating painter
        PainterSupport.uninstallPainter ( popupMenu, this.painter );
        final Painter oldPainter = this.painter;
        this.painter = properPainter;
        applyPainterSettings ( properPainter );
        PainterSupport.installPainter ( popupMenu, properPainter );

        // Firing painter change event
View Full Code Here

            final JPopupMenu popupMenu = ( JPopupMenu ) parent;
            if ( popupMenu.getUI () instanceof WebPopupMenuUI )
            {
                // Checking whether web-painter is used or not
                final WebPopupMenuUI ui = ( WebPopupMenuUI ) popupMenu.getUI ();
                final Painter painter = ui.getPainter ();
                if ( painter instanceof WebPopupMenuPainter )
                {
                    // Checking painter sttyle
                    final WebPopupMenuPainter webPainter = ( WebPopupMenuPainter ) painter;
                    if ( webPainter.getPopupStyle () == PopupStyle.dropdown )
View Full Code Here

TOP

Related Classes of com.alee.extended.painter.Painter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.