Skip to content

Commit

Permalink
Updates for v1.26 release
Browse files Browse the repository at this point in the history
#77 - Even more changes for Swing UI properties
Improvements made to Painter interface
Full painter support implemented for WebScrollBarUI
A lot of improvements done to WebScrollBarUI
WebListUI rollover cell display fixed
WebFileChooserPanel history list file name length limit added
WebSplitButton UI class name fixed
Various small JavaDoc fixes
  • Loading branch information
mgarin committed Jan 29, 2014
1 parent b1af35b commit ef7d040
Show file tree
Hide file tree
Showing 72 changed files with 3,192 additions and 606 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ https://github.com/mgarin/weblaf/releases

Here are the direct links for the latest release:

1. [**weblaf-1.25.jar**](https://github.com/mgarin/weblaf/releases/download/v1.25/weblaf-1.25.jar) - library jar
2. [**weblaf-simple-1.25.jar**](https://github.com/mgarin/weblaf/releases/download/v1.25/weblaf-simple-1.25.jar) - library jar without dependencies
3. [**weblaf-src-1.25.zip**](https://github.com/mgarin/weblaf/releases/download/v1.25/weblaf-src-1.25.zip) - project sources zip
4. [**weblaf-demo-1.25.jar**](https://github.com/mgarin/weblaf/releases/download/v1.25/weblaf-demo-1.25.jar) - executable demo jar
5. [**weblaf-javadoc-1.25.zip**](https://github.com/mgarin/weblaf/releases/download/v1.25/weblaf-javadoc-1.25.zip) - JavaDoc zip
6. [**ninepatch-editor-1.25.jar**](https://github.com/mgarin/weblaf/releases/download/v1.25/ninepatch-editor-1.25.jar) - executable 9-patch editor jar
1. [**weblaf-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-1.26.jar) - library jar
2. [**weblaf-simple-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-simple-1.26.jar) - library jar without dependencies
3. [**weblaf-src-1.26.zip**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-src-1.26.zip) - project sources zip
4. [**weblaf-demo-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-demo-1.26.jar) - executable demo jar
5. [**weblaf-javadoc-1.26.zip**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-javadoc-1.26.zip) - JavaDoc zip
6. [**ninepatch-editor-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/ninepatch-editor-1.26.jar) - executable 9-patch editor jar


Roadmap
Expand Down
4 changes: 2 additions & 2 deletions build/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Mon Oct 28 20:49:53 MSK 2013
build.number=26
#Wed Jan 29 16:43:10 MSK 2014
build.number=27
version.number=1
72 changes: 36 additions & 36 deletions src/com/alee/extended/breadcrumb/BreadcrumbElementPainter.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,54 +81,54 @@ public int getOverlap ()
return overlap;
}

public void setOverlap ( int overlap )
public void setOverlap ( final int overlap )
{
this.overlap = overlap;
borderShapeCache.clear ();
fireUpdate ();
updateAll ();
}

public BreadcrumbElementType getType ()
{
return type;
}

public void setType ( BreadcrumbElementType type )
public void setType ( final BreadcrumbElementType type )
{
this.type = type;
borderShapeCache.clear ();
fireUpdate ();
updateAll ();
}

public boolean isShowProgress ()
{
return showProgress;
}

public void setShowProgress ( boolean showProgress )
public void setShowProgress ( final boolean showProgress )
{
this.showProgress = showProgress;
fireRepaint ();
repaint ();
}

public float getProgress ()
{
return progress;
}

public void setProgress ( float progress )
public void setProgress ( final float progress )
{
this.progress = Math.min ( 1f, progress );
fireRepaint ();
repaint ();
}

/**
* {@inheritDoc}
*/
@Override
public Insets getMargin ( E c )
public Insets getMargin ( final E c )
{
int left;
final int left;
if ( type.equals ( BreadcrumbElementType.none ) )
{
left = 0;
Expand All @@ -137,7 +137,7 @@ public Insets getMargin ( E c )
{
left = type.equals ( BreadcrumbElementType.start ) ? 0 : overlap;
}
int right;
final int right;
if ( type.equals ( BreadcrumbElementType.none ) )
{
right = 0;
Expand All @@ -153,7 +153,7 @@ public Insets getMargin ( E c )
* {@inheritDoc}
*/
@Override
public void paint ( Graphics2D g2d, Rectangle bounds, E c )
public void paint ( final Graphics2D g2d, final Rectangle bounds, final E c )
{
final int br = BreadcrumbUtils.getRound ( c );
final boolean ltr = c.getComponentOrientation ().isLeftToRight ();
Expand All @@ -165,8 +165,8 @@ public void paint ( Graphics2D g2d, Rectangle bounds, E c )
boolean selected = false;
if ( c instanceof AbstractButton )
{
AbstractButton ab = ( AbstractButton ) c;
ButtonModel bm = ab.getModel ();
final AbstractButton ab = ( AbstractButton ) c;
final ButtonModel bm = ab.getModel ();
selected = bm.isPressed () || bm.isSelected ();
}

Expand Down Expand Up @@ -215,15 +215,15 @@ public void paint ( Graphics2D g2d, Rectangle bounds, E c )
// Progress background
if ( showProgress && progress > 0f )
{
Shape progressFillShape = getProgressFillShape ( c, fs );
Rectangle pb = progressFillShape.getBounds ();
final Shape progressFillShape = getProgressFillShape ( c, fs );
final Rectangle pb = progressFillShape.getBounds ();

// Background fill
g2d.setPaint ( getProgressPaint ( c ) );
g2d.fill ( progressFillShape );

// Line with proper background-shaped clipping
Shape oldClip = LafUtils.intersectClip ( g2d, fs );
final Shape oldClip = LafUtils.intersectClip ( g2d, fs );
g2d.setPaint ( getProgressLinePaint ( c ) );
g2d.drawLine ( ltr ? pb.x + pb.width : pb.x, pb.y, ltr ? pb.x + pb.width : pb.x, pb.y + pb.height );
LafUtils.restoreClip ( g2d, oldClip );
Expand All @@ -233,26 +233,26 @@ public void paint ( Graphics2D g2d, Rectangle bounds, E c )
LafUtils.restoreAntialias ( g2d, old );
}

protected LinearGradientPaint getProgressPaint ( E c )
protected LinearGradientPaint getProgressPaint ( final E c )
{
boolean pressed = false;
if ( c instanceof AbstractButton )
{
ButtonModel bm = ( ( AbstractButton ) c ).getModel ();
final ButtonModel bm = ( ( AbstractButton ) c ).getModel ();
pressed = bm.isPressed () || bm.isSelected ();
}
return new LinearGradientPaint ( 0, 0, 0, c.getHeight (), progressFractions,
pressed ? selectedProgressFillColors : progressFillColors );
}

protected LinearGradientPaint getProgressLinePaint ( E c )
protected LinearGradientPaint getProgressLinePaint ( final E c )
{
return new LinearGradientPaint ( 0, 0, 0, c.getHeight (), progressFractions, progressLineColors );
}

public GeneralPath getBorderShape ( E c, boolean ltr )
public GeneralPath getBorderShape ( final E c, final boolean ltr )
{
String key = ltr + ":" + c.getWidth () + "," + c.getHeight ();
final String key = ltr + ":" + c.getWidth () + "," + c.getHeight ();
GeneralPath bs = borderShapeCache.get ( key );
if ( bs == null )
{
Expand All @@ -263,9 +263,9 @@ public GeneralPath getBorderShape ( E c, boolean ltr )
return bs;
}

protected GeneralPath getBorderShapeImpl ( E c, boolean ltr )
protected GeneralPath getBorderShapeImpl ( final E c, final boolean ltr )
{
GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
final GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
if ( ltr )
{
gp.moveTo ( c.getWidth () - overlap - shadeWidth - 1, -1 );
Expand All @@ -281,9 +281,9 @@ protected GeneralPath getBorderShapeImpl ( E c, boolean ltr )
return gp;
}

public Shape getFillShape ( E c, boolean ltr, int round )
public Shape getFillShape ( final E c, final boolean ltr, final int round )
{
String key = ltr + ":" + round + ":" + c.getWidth () + "," + c.getHeight ();
final String key = ltr + ":" + round + ":" + c.getWidth () + "," + c.getHeight ();
Shape fs = fillShapeCache.get ( key );
if ( fs == null )
{
Expand All @@ -294,11 +294,11 @@ public Shape getFillShape ( E c, boolean ltr, int round )
return fs;
}

protected Shape getFillShapeImpl ( E c, boolean ltr, int round )
protected Shape getFillShapeImpl ( final E c, final boolean ltr, final int round )
{
final int width = c.getWidth ();
final int height = c.getHeight ();
boolean encloseLast = isEncloseLastElement ( c );
final boolean encloseLast = isEncloseLastElement ( c );
if ( c.getParent () != null && c.getParent ().getComponentCount () == 1 && !encloseLast )
{
if ( round > 0 )
Expand All @@ -312,7 +312,7 @@ protected Shape getFillShapeImpl ( E c, boolean ltr, int round )
}
else if ( !type.equals ( BreadcrumbElementType.end ) )
{
GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
final GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
if ( ltr )
{
gp.moveTo ( width - overlap - shadeWidth - 1, 0 );
Expand Down Expand Up @@ -357,7 +357,7 @@ else if ( !type.equals ( BreadcrumbElementType.end ) )
{
if ( round > 0 )
{
GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
final GeneralPath gp = new GeneralPath ( GeneralPath.WIND_EVEN_ODD );
if ( ltr )
{
gp.moveTo ( 0, 0 );
Expand Down Expand Up @@ -386,19 +386,19 @@ else if ( !type.equals ( BreadcrumbElementType.end ) )
}
}

protected boolean isEncloseLastElement ( E c )
protected boolean isEncloseLastElement ( final E c )
{
return c.getParent () != null && c.getParent () instanceof WebBreadcrumb &&
( ( WebBreadcrumb ) c.getParent () ).isEncloseLastElement ();
}

public Shape getProgressFillShape ( E c, Shape fillShape )
public Shape getProgressFillShape ( final E c, final Shape fillShape )
{
boolean ltr = c.getComponentOrientation ().isLeftToRight ();
Area fill = new Area ( fillShape );
final boolean ltr = c.getComponentOrientation ().isLeftToRight ();
final Area fill = new Area ( fillShape );

Rectangle bounds = fill.getBounds ();
int oldWidth = bounds.width;
final Rectangle bounds = fill.getBounds ();
final int oldWidth = bounds.width;
bounds.width = Math.round ( oldWidth * progress );
bounds.x = ltr ? bounds.x : bounds.x + oldWidth - bounds.width;
fill.intersect ( new Area ( bounds ) );
Expand Down
10 changes: 5 additions & 5 deletions src/com/alee/extended/button/WebSplitButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class WebSplitButton extends WebButton implements MouseMotionListener, Mo
*
* @see #getUIClassID
*/
private static final String uiClassID = "TristateCheckBoxUI";
private static final String uiClassID = "SplitButtonUI";

/**
* Whether should always display popup menu when button is clicked or not.
Expand Down Expand Up @@ -231,9 +231,9 @@ public PopupMenuWay getPopupMenuWay ()
*
* @param way approximate popup menu display way
*/
public void setPopupMenuWay ( final PopupMenuWay popupMenuWay )
public void setPopupMenuWay ( final PopupMenuWay way )
{
this.popupMenuWay = popupMenuWay;
this.popupMenuWay = way;
}

/**
Expand Down Expand Up @@ -449,7 +449,7 @@ public void mouseExited ( final MouseEvent e )
* parameter.
*
* @param event the <code>ActionEvent</code> object
* @see EventListenerList
* @see javax.swing.event.EventListenerList
*/
protected void fireButtonClicked ( final ActionEvent event )
{
Expand Down Expand Up @@ -485,7 +485,7 @@ protected void fireButtonClicked ( final ActionEvent event )
* parameter.
*
* @param event the <code>ActionEvent</code> object
* @see EventListenerList
* @see javax.swing.event.EventListenerList
*/
protected void fireSplitbuttonClicked ( final ActionEvent event )
{
Expand Down
Loading

0 comments on commit ef7d040

Please sign in to comment.