Determine the button painter variant from the component's client
property.

@param  c the component.

@return the button painter variant.
484403
private ButtonVariantPainter getButtonPainter(JComponent c) {
        Object               buttonType = c.getClientProperty("JButton.buttonType");
        ButtonVariantPainter button     = standard;

        if ("textured".equals(buttonType) || "segmentedTextured".equals(buttonType)) {
            button = textured;
        }

        return button;
    }
77369
public static String findComponentFormId(FacesContext fc, UIComponent c) {
		UIComponent parent = c.getParent();

		while (parent != null) {
			if (parent instanceof UIForm) {
				return parent.getClientId(fc);
			}
			parent = parent.getParent();
		}
		return null;
	}
220295
protected int getScreenResolution(Component c) {
        if (c == null) {
            return getDefaultScreenResolution();
        }

        Toolkit toolkit = c.getToolkit();
        return toolkit != null
                ? toolkit.getScreenResolution()
                : getDefaultScreenResolution();
    }
985093
def colors=(c)
      @colors = c.is_a?(ColorPair) ? c : ColorPair.for(c).first
      @win.bkgd(Ncurses.COLOR_PAIR(@colors.id)) unless @win.nil?

      component.colors = @colors if component?

      children.each { |ch|
        ch.colors = c
      }
    end
904070
public static Type getType(final Class c) {
        if (c.isPrimitive()) {
            if (c == Integer.TYPE) {
                return INT_TYPE;
            } else if (c == Void.TYPE) {
                return VOID_TYPE;
            } else if (c == Boolean.TYPE) {
                return BOOLEAN_TYPE;
            } else if (c == Byte.TYPE) {
                return BYTE_TYPE;
            } else if (c == Character.TYPE) {
                return CHAR_TYPE;
            } else if (c == Short.TYPE) {
                return SHORT_TYPE;
            } else if (c == Double.TYPE) {
                return DOUBLE_TYPE;
            } else if (c == Float.TYPE) {
                return FLOAT_TYPE;
            } else /* if (c == Long.TYPE) */{
                return LONG_TYPE;
            }
        } else {
            return getType(getDescriptor(c));
        }
    }
67980
private void updateStyle(JTextComponent c) {
        SeaGlassContext context  = getContext(c, ENABLED);
        SynthStyle      oldStyle = style;

        SynthStyle s = SeaGlassLookAndFeel.updateStyle(context, this);
        if (s instanceof SeaGlassStyle) {
            style = (SeaGlassStyle) s;

            updateSearchStyle(c, context, getPropertyPrefix());

            if (style != oldStyle) {
                updateStyle(c, context, getPropertyPrefix());

                if (oldStyle != null) {
                    uninstallKeyboardActions();
                    installKeyboardActions();
                }
            }
        }
        
        context.dispose();

        context   = getContext(c, SeaGlassRegion.SEARCH_FIELD_FIND_BUTTON, ENABLED);
        findStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();

        context     = getContext(c, SeaGlassRegion.SEARCH_FIELD_CANCEL_BUTTON, ENABLED);
        cancelStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();
    }
433659
private Component createConvertToPropertyBundleButton() {

        Button addDescriptorButton = CmsToolBar.createButton(
            FontOpenCms.SETTINGS,
            m_messages.key(Messages.GUI_CONVERT_TO_PROPERTY_BUNDLE_0));

        addDescriptorButton.setDisableOnClick(true);

        addDescriptorButton.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                try {
                    m_model.saveAsPropertyBundle();
                    Notification.show("Conversion successful.");
                } catch (CmsException | IOException e) {
                    CmsVaadinUtils.showAlert("Conversion failed", e.getLocalizedMessage(), null);
                }
            }
        });
        addDescriptorButton.setDisableOnClick(true);
        return addDescriptorButton;
    }
1135895
public static int getGraphicsDeviceIndexIsShowingOn(final Component component)
	{
		final GraphicsDevice graphicsDevice = getGraphicsDeviceIsShowingOn(component);
		final GraphicsDevice[] graphicsDevices = getAvailableScreens();
		for (int i = 0; i < graphicsDevices.length; i++)
		{
			if (graphicsDevices[i].equals(graphicsDevice))
			{
				return i;
			}
		}
		return 0;
	}
933419
@SuppressWarnings("unchecked")
	<T extends Component> T getComponent (ComponentType componentType) {
		int componentTypeIndex = componentType.getIndex();

		if (componentTypeIndex < components.getCapacity()) {
			return (T)components.get(componentType.getIndex());
		} else {
			return null;
		}
	}
1278872
private void updateStyle(JPanel c) {
        SeaGlassContext context = getContext(c, ENABLED);

        style = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();

        // Set the opacity according to whether the background has been set.
        // Don't set it if the user has already set it.
        LookAndFeel.installProperty(c, "opaque", !(c.getBackground() instanceof UIResource));
    }
288807
private CommonControlState getButtonType(Which state) {
        switch (state) {

        case BACKGROUND_DISABLED:
            return CommonControlState.DISABLED;

        case BACKGROUND_ENABLED:
            return CommonControlState.ENABLED;

        case BACKGROUND_PRESSED:
        case BACKGROUND_SELECTED:
            return CommonControlState.PRESSED;

        case FOREGROUND_ENABLED:
        case FOREGROUND_PRESSED:
        case FOREGROUND_SELECTED:
        case FOREGROUND_ENABLED_EDITABLE:
            return CommonControlState.ENABLED;

        case FOREGROUND_DISABLED:
        case FOREGROUND_DISABLED_EDITABLE:
            return CommonControlState.DISABLED;
        }

        return null;
    }
972633
private FourColors getTableHeaderColors(CommonControlState type, boolean isSorted) {
        switch (type) {

        case DISABLED:
            return isSorted ? tableHeaderDisabledSorted : tableHeaderDisabled;

        case ENABLED:
            return isSorted ? tableHeaderSorted : tableHeaderEnabled;

        case PRESSED:
            return tableHeaderPressed;
        }

        return null;
    }
584216
private Paint getPreparedPaint() {
		getActionButton().resetPaint();
		Paint paint = getActionButton().getPaint();
		paint.setStyle(Paint.Style.FILL);
		paint.setColor(getActionButton().getButtonColorRipple());
		return paint;
	}
919797
public static void colorButton( JButton button, Color color, Integer size ) {
        if (size == null)
            size = 15;
        BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
        Graphics2D gr = (Graphics2D) bi.getGraphics();
        gr.setColor(color);
        gr.fillRect(0, 0, size, size);
        gr.dispose();

        button.setIcon(new ImageIcon(bi));
    }
455922
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)
	{
		try
		{
			Rectangle r = c.modelToView(c.getCaretPosition());
			g.setColor( color );
			g.fillRect(0, r.y, c.getWidth(), r.height);

			if (lastView == null)
				lastView = r;
		}
		catch(BadLocationException ble) {System.out.println(ble);}
	}
467688
public static StringType char2StringType(CharType c) {
		switch(c){
		case D: return StringType.D;
		case C: return StringType.C;
		case L: return StringType.L;
		case B: return StringType.B;
		default: return StringType.O;
		}
	}
650762
public SeaGlassContext getContext(JComponent c, int state) {
        return SeaGlassContext.getContext(SeaGlassContext.class, c, SeaGlassLookAndFeel.getRegion(c), style, state);
    }