use of java.awt.Color in project screenbird by adamhub.
the class JRoundedPanel method paintComponent.
// public JRoundedPanel(CardLayout cardLayout) {
// super(cardLayout);
// setOpaque(false);
// Color backgrnd = new Color(Color.darkGray.getRed(),Color.darkGray.getGreen(), Color.darkGray.getBlue(),180);
// this.setBackground(backgrnd);
// }
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
int width = getWidth();
int height = getHeight();
int shadowGap = this.shadowGap;
Color shadowColorA = new Color(shadowColor.getRed(), shadowColor.getGreen(), shadowColor.getBlue(), shadowAlpha);
Graphics2D graphics = (Graphics2D) g;
//Sets antialiasing if HQ.
if (highQuality) {
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
//Draws shadow borders if any.
if (shady) {
graphics.setColor(shadowColorA);
graphics.fillRoundRect(// X position
shadowOffset, // Y position
shadowOffset, // width
width - strokeSize - shadowOffset, // height
height - strokeSize - shadowOffset, arcs.width, // arc Dimension
arcs.height);
} else {
shadowGap = 1;
}
//Draws the rounded opaque panel with borders.
graphics.setColor(getBackground());
graphics.fillRoundRect(0, 0, width - shadowGap, height - shadowGap, arcs.width, arcs.height);
graphics.setColor(getForeground());
//graphics.setStroke(new BasicStroke(strokeSize));
//graphics.drawRoundRect(0, 0, width - shadowGap, height - shadowGap, arcs.width, arcs.height);
//Sets strokes to default, is better.
graphics.setStroke(new BasicStroke());
}
use of java.awt.Color in project screenbird by adamhub.
the class RecorderPanel method adjustClockTimerFont.
// End of variables declaration//GEN-END:variables
public void adjustClockTimerFont() {
Color color = jLabel6.getForeground();
Font labelFont = jLabel6.getFont();
String labelText = jLabel6.getText();
int stringWidth = jLabel6.getFontMetrics(labelFont).stringWidth(labelText);
int componentWidth = jLabel6.getWidth();
double widthRatio = (double) componentWidth / (double) stringWidth;
int newFontSize = (int) (labelFont.getSize() * widthRatio * 0.9);
int componentHeight = (int) (jLabel6.getHeight() * 0.9);
int fontSizeToUse = Math.min(newFontSize, componentHeight);
jLabel6.setFont(new Font(labelFont.getName(), jLabel6.getFont().getStyle(), fontSizeToUse));
jLabel6.setForeground(color);
jLabel6.repaint();
}
use of java.awt.Color in project screenbird by adamhub.
the class RecorderPanel method showRecordingState.
/**
* Shows recorder panel in recording sate
*/
public void showRecordingState() {
// Show recorder controls
this.jfRecorderPanel.controlSetVisible(true);
// Stop preview playback, if any
if (this.scrubManager != null) {
this.scrubManager.endPreviewVideo();
}
// Hide settings form
if (jfSettings != null) {
this.jfSettings.hideSettingsForm();
}
// Hide capture box
if (this.captureBox != null) {
this.setToggleStateCustomFullScreen(this.captureBox.getState(), false);
this.captureBox.setDragBoxVisible(false);
}
this.jpUpload.setVisible(false);
this.jpRecorderNonRec.setVisible(false);
this.recorderPanelBG1.setVisible(true);
this.jToggleButton1.setEnabled(false);
this.jToggleButton2.setEnabled(false);
this.jToggleButton3.setSelected(true);
this.jLabel6.setForeground(new Color(148, 148, 148));
this.jpRecorderRec.setVisible(false);
jToggleButton3.setToolTipText("Stop");
jToggleButton3.setEnabled(true);
jToggleButton3.setIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_NORMAL)));
jToggleButton3.setSelectedIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_PRESSED)));
jToggleButton3.setDisabledIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_DISABLED)));
jToggleButton3.setDisabledSelectedIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_DISABLED)));
jToggleButton3.setRolloverIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_HOVER)));
jToggleButton3.setRolloverSelectedIcon(new ImageIcon(getClass().getResource(ResourceUtil.STOP_BUTTON_HOVER)));
jToggleButton4.setEnabled(true);
if (Settings.ENABLE_OOPS_FEATURE) {
this.jfRecorderPanel.controlPack();
} else {
this.jpRecorderRec.setVisible(false);
}
}
use of java.awt.Color in project screenbird by adamhub.
the class RecorderPanelBG method paint.
@Override
public void paint(Graphics g) {
g.drawImage(img, 0, 0, new Color(0, 0, 0, 0), this);
paintComponents(g);
}
use of java.awt.Color in project screenbird by adamhub.
the class RecorderPanelTest method testShowUploadMessage.
/**
* Test of showUploadMessage method, of class RecorderPanel.
*/
@Test
public void testShowUploadMessage() {
System.out.println("showUploadMessage");
String message = "Test Message";
Color type = Color.WHITE;
instance.showUploadMessage(message, type);
TimeUtil.skipToMyLou(2);
instance.showRecorderForm();
}
Aggregations