}
public static PictureGraphic newPictureGraphic(String name){ //PM:5/11/07
return newPictureGraphic(name, Constants.CG_DEFAULT);
}
public static PictureGraphic newPictureGraphic(String name, int imageGravity){
PictureGraphic jl = new PictureGraphic();
jl.setBackground(null);
jl.setName(name);
jl.setFocusable(false);
switch (imageGravity) {
case Constants.CG_TOPLEFT:
jl.setHorizontalAlignment(SwingConstants.LEFT);
jl.setVerticalAlignment(SwingConstants.TOP);
case Constants.CG_TOPCENTER:
jl.setHorizontalAlignment(SwingConstants.CENTER);
jl.setVerticalAlignment(SwingConstants.TOP);
case Constants.CG_TOPRIGHT:
jl.setHorizontalAlignment(SwingConstants.RIGHT);
jl.setVerticalAlignment(SwingConstants.TOP);
case Constants.CG_MIDDLELEFT:
jl.setHorizontalAlignment(SwingConstants.LEFT);
jl.setVerticalAlignment(SwingConstants.CENTER);
case Constants.CG_MIDDLERIGHT:
jl.setHorizontalAlignment(SwingConstants.RIGHT);
jl.setVerticalAlignment(SwingConstants.CENTER);
case Constants.CG_BOTTOMLEFT:
jl.setHorizontalAlignment(SwingConstants.LEFT);
jl.setVerticalAlignment(SwingConstants.BOTTOM);
case Constants.CG_BOTTOMCENTER:
jl.setHorizontalAlignment(SwingConstants.CENTER);
jl.setVerticalAlignment(SwingConstants.BOTTOM);
case Constants.CG_BOTTOMRIGHT:
jl.setHorizontalAlignment(SwingConstants.RIGHT);
jl.setVerticalAlignment(SwingConstants.BOTTOM);
default:
jl.setHorizontalAlignment(SwingConstants.CENTER);
jl.setVerticalAlignment(SwingConstants.CENTER);
}
return jl;
}