DOCUMENT ME!

@param  b             DOCUMENT ME!
@param  synthConstant DOCUMENT ME!

@return DOCUMENT ME!
778675
private Icon getSynthIcon(AbstractButton b, int synthConstant) {
        return style.getIcon(getContext(b, synthConstant), getPropertyPrefix() + "icon");
    }
49492
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
    {
        if ((strValue == null) || (strValue.length() == 0))
            return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
        if (TEN_SPACES.equals(strValue))
            return DBConstants.NORMAL_RETURN;
        return super.setString(strValue, bDisplayOption, iMoveMode);
    }
154531
private Icon getSelectedIcon(AbstractButton b, Icon defaultIcon) {
        return getIcon(b, b.getSelectedIcon(), defaultIcon, SynthConstants.SELECTED);
    }
1362491
public T elementPower( double b )
    {
        T c = createLike();
        ops.elementPower(mat,b,c.mat);
        return c;
    }
1117913
public static void callStringBuilderToString(CodeBuilder b) {
        // Because of JDK1.5 bug which exposes AbstractStringBuilder class,
        // cannot use reflection to get method signature.
        TypeDesc stringBuilder = TypeDesc.forClass(StringBuilder.class);
        b.invokeVirtual(stringBuilder, "toString", TypeDesc.STRING, null);
    }
1017821
public static Map<String, Object> getConstantFrom(Class clazz, // NL
                                                 boolean findAncestor, boolean findInterfaces) {

        HashMap<String, Object> map = new HashMap<String, Object>();

        if (findInterfaces) {
            for (Class interfaceClass : clazz.getInterfaces()) {
                fillConstantFrom(interfaceClass, map);
            }
        }

        if (findAncestor) {
            Class superClass = clazz;
            while (superClass != null) {
                fillConstantFrom(superClass, map);
                superClass = superClass.getSuperclass();
            }
        }

        fillConstantFrom(clazz, map);

        return map;
    }
1251459
public static int inc(int value, int r, int g, int b)
    {
        final int alpha = value >> Constant.BYTE_4 & 0xFF;
        if (alpha == 0)
        {
            return 0;
        }
        final int red = value >> Constant.BYTE_3 & 0xFF;
        final int green = value >> Constant.BYTE_2 & 0xFF;
        final int blue = value >> Constant.BYTE_1 & 0xFF;

        final int alphaMask = (UtilMath.clamp(alpha, 0, 255) & 0xFF) << Constant.BYTE_4;
        final int redMask = (UtilMath.clamp(red + r, 0, 255) & 0xFF) << Constant.BYTE_3;
        final int greenMask = (UtilMath.clamp(green + g, 0, 255) & 0xFF) << Constant.BYTE_2;
        final int blueMask = (UtilMath.clamp(blue + b, 0, 255) & 0xFF) << Constant.BYTE_1;

        return alphaMask | redMask | greenMask | blueMask;
    }
456119
public static <T> Function<Object, T> returnConstant(final T constant) {
    return new Function<Object, T>() {
      @Override
      public T apply(Object ignored) {
        return constant;
      }
    };
  }
1009266
public static String byteArrayToNumString(byte[] b) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < b.length; i++) {
			sb.append(byteToNumString(b[i]));
		}
		return new String(sb);
	}
1000673
public static void callStringBuilderAppendChar(CodeBuilder b) {
        // Because of JDK1.5 bug which exposes AbstractStringBuilder class,
        // cannot use reflection to get method signature.
        TypeDesc stringBuilder = TypeDesc.forClass(StringBuilder.class);
        b.invokeVirtual(stringBuilder, "append", stringBuilder, new TypeDesc[] {TypeDesc.CHAR});
    }
909043
public static int setAbstract(int modifier, boolean b) {
        if (b) {
            return (modifier | ABSTRACT) & 
                (~FINAL & ~VOLATILE & ~TRANSIENT & ~NATIVE &
                 ~SYNCHRONIZED & ~STRICT);
        }
        else {
            return modifier & ~ABSTRACT & ~INTERFACE;
        }
    }
120489
public void setMiddleNote(Note n) {
		//same note has middle, maybe with octave
		byte strictHeight = n.getStrictHeight();
		boolean set = false;
		if (strictHeight == getMiddleNote().getStrictHeight()) {
			set = true;
		} else {
			//some accepted cases
			Clef[] toCompare = null;
			if (isG()) {
				toCompare = new Clef[] { TREBLE, FRENCH_VIOLIN };
			} else if (isF()) {
				toCompare = new Clef[] { BASS, BARITONE };
			} else if (isC()) {
				toCompare = new Clef[] { SOPRANO, MEZZOSOPRANO, ALTO, TENOR };
			}
			if (toCompare != null) {
                for (Clef aToCompare : toCompare) {
                    if (strictHeight == aToCompare.getMiddleNote().getStrictHeight()) {
                        m_lineNumber = (byte) aToCompare.getLineNumber();
                        set = true;
                        break;
                    }
                }
			}
			//Accept any note as middle
			if (isPerc()) {
				set = true;
			}
		}
		if (set) {
			//if linenumber has changed, recompute middle note
			reset();
			//compute invisible octave transposition
			m_invisibleOctaveTransp =
				(byte)(n.getOctaveTransposition()
					- getMiddleNote().getOctaveTransposition());
			m_middleNote = n;
			reset();
		}
	}
3036
static String constantValueExpression(Object cb) {
        if (cb == null) return null;
        if (cb instanceof Character) return sourceForm(((Character)cb).charValue());
        if (cb instanceof Byte) return sourceForm(((Byte)cb).byteValue());
        if (cb instanceof String) return sourceForm((String)cb);
        if (cb instanceof Double) return sourceForm(((Double)cb).doubleValue(), 'd');
        if (cb instanceof Float) return sourceForm(((Float)cb).doubleValue(), 'f');
        if (cb instanceof Long) return cb + "L";
        return cb.toString(); // covers int, short
    }
1043862
@SuppressWarnings("all")
    public SynthPainter getPainter() {
        SynthPainter painter = getStyle().getPainter(this);

        if (painter != null) {
            return painter;
        }

        return EMPTY_PAINTER;
    }
362959
public B substituteProperties(final B b, final Properties submittedProps) {

		return this.substituteProperties(b, submittedProps, null);

	}
1182787
public boolean printToolbarControl(boolean bFieldsFound, PrintWriter out, int iHtmlAttributes)
    {
        out.println(Utility.startTag("toolbars"));
        int iNumCols = ((ToolScreen)this.getScreenField()).getSFieldCount();
        for (int iIndex = 0; iIndex < iNumCols; iIndex++)
        {
            ScreenField sField = ((ToolScreen)this.getScreenField()).getSField(iIndex);
            if (sField.getConverter() == null)
                if (sField instanceof SCannedBox)
            {
                SCannedBox button = (SCannedBox)sField;   // Found the toolscreen
                String strCommand = button.getButtonCommand();
                if (strCommand.equalsIgnoreCase(MenuConstants.BACK))
                { // Ignore back for HTML
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.HELP))
                { // Ignore help for HTML
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.RESET))
                {   // Special case - for reset do an HTML reset
                    out.println(" <xfm:submit name=\"" + MenuConstants.RESET + "\" ref=\"" + MenuConstants.RESET + "\">");
                    out.println("   <xfm:hint>Click to reset</xfm:hint>");
                    out.println("   <xfm:image>" + MenuConstants.RESET + "</xfm:image>");
                    out.println("   <xfm:caption>" + MenuConstants.RESET + "</xfm:caption>");
                    out.println(" </xfm:submit>");
                    bFieldsFound = false; // Don't need Submit/Reset button
                }
                else if ((strCommand.equalsIgnoreCase(MenuConstants.FIRST))
                        || (strCommand.equalsIgnoreCase(MenuConstants.PREVIOUS))
                        || (strCommand.equalsIgnoreCase(MenuConstants.NEXT))
                        || (strCommand.equalsIgnoreCase(MenuConstants.LAST))
                        || (strCommand.equalsIgnoreCase(MenuConstants.SUBMIT))
                        || (strCommand.equalsIgnoreCase(MenuConstants.DELETE)))
                { // Valid command - send it as a post command
                    out.println(" <xfm:submit name=\"" + DBParams.COMMAND + "\" ref=\"" + strCommand + "\" to=\"submit1\">");
                    out.println("   <xfm:hint>Click to submit</xfm:hint>");
                    out.println("   <xfm:image>" + strCommand + "</xfm:image>");
                    out.println("   <xfm:caption>" + strCommand + "</xfm:caption>");
                    out.println(" </xfm:submit>");
                    bFieldsFound = false; // Don't need Submit button
                }
                else if ((strCommand.equalsIgnoreCase(MenuConstants.FORM)) || (strCommand.equalsIgnoreCase(MenuConstants.FORMLINK)))
                { // Valid command - send it as a post command
                    strCommand = MenuConstants.FORM;
                    String strRecord = this.getMainRecord().getClass().getName().toString();
                    String strLink = "?" + DBParams.RECORD + "=" + strRecord + "&amp;" + DBParams.COMMAND + "=" + strCommand;
                    out.println(" <xfm:trigger name=\"" + strCommand + "\" ref=\"" + strLink + "\">");
                    out.println("   <xfm:hint>Form view</xfm:hint>");
                    out.println("   <xfm:image>" + strCommand + "</xfm:image>");
                    out.println("   <xfm:caption>" + strCommand + "</xfm:caption>");
                    out.println(" </xfm:trigger>");
                }
                else if (strCommand.equalsIgnoreCase(MenuConstants.LOOKUP))
                { // Valid command - send it as a post command
                	String strLink = null;
                	if (this.getMainRecord() != null)
                	{
                		String strRecord = this.getMainRecord().getClass().getName().toString();
                		strLink = "?" + DBParams.RECORD + "=" + strRecord;
                	}
                	else
                	{
                		String strScreen = this.getScreenField().getParentScreen().getClass().getName().toString();
                		strLink = "?" + DBParams.SCREEN + "=" + strScreen;               		
                	}
                    out.println(" <xfm:trigger name=\"" + strCommand + "\" ref=\"" + strLink + "\">");
                    out.println("   <xfm:hint>Form view</xfm:hint>");
                    out.println("   <xfm:image>" + strCommand + "</xfm:image>");
                    out.println("   <xfm:caption>" + strCommand + "</xfm:caption>");
                    out.println(" </xfm:trigger>");
                }
                else
                { // Valid command - send it as a post command
                    //+ Add code here to process a doCommand(xxx)
                }
            }
        }
        if (this.getScreenField().getParentScreen() instanceof GridScreen)
            bFieldsFound = false;        // Don't Need these buttons for grid display
        if (this.getScreenField().getParentScreen() instanceof BaseReportScreen)
            if (HtmlConstants.DISPLAY.equalsIgnoreCase(this.getProperty(HtmlConstants.FORMS)))
                bFieldsFound = false;        // Don't Need these buttons for grid display
//            if (!this.getScreenField().getParentScreen().getEditing())
//                bFieldsFound = false;        // Don't Need these buttons for grid display
        if (bFieldsFound)
        {
            out.println(" <xfm:submit name=\"" + DBParams.COMMAND + "\" ref=\"" + MenuConstants.SUBMIT + "\" to=\"submit1\">");
            out.println("   <xfm:hint>Click to submit</xfm:hint>");
            out.println("   <xfm:image>" + MenuConstants.SUBMIT + "</xfm:image>");
            out.println("   <xfm:caption>" + MenuConstants.SUBMIT + "</xfm:caption>");
            out.println(" </xfm:submit>");

            out.println(" <xfm:submit name=\"" + MenuConstants.RESET + "\" ref=\"" + MenuConstants.RESET + "\">");
            out.println("   <xfm:hint>Click to reset</xfm:hint>");
            out.println("   <xfm:image>" + MenuConstants.RESET + "</xfm:image>");
            out.println("   <xfm:caption>" + MenuConstants.RESET + "</xfm:caption>");
            out.println(" </xfm:submit>");
        }
        out.println(Utility.endTag("toolbars"));
        return bFieldsFound;
    }
1170623
public static String format(boolean[] b, final String sep) {
    return (b == null) ? "null" : (b.length == 0) ? "" : //
        formatTo(new StringBuilder(), b, ", ").toString();
  }