public void update_config(Graphics2D g2) {

        // we got here because one of the settings has been changed

        // clear the flags
        this.resized = false;
        this.reconfig = false;

        // anti-aliasing
        this.rendering_hints.put(RenderingHints.KEY_ANTIALIASING, preferences.get_anti_alias() ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);
        this.rendering_hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, preferences.get_anti_alias() ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);

        // define the colors
        set_colors( preferences.get_use_more_color(), preferences.get_border_color() );
        border_gradient = new GradientPaint(
                0, 0, backpanel_color.darker().darker().darker(),
                frame_size.width, frame_size.height , backpanel_color.brighter(),
                true);

        // switch width and height if the instrument is displayed on its side
        if ( ( preferences.get_panel_orientation(this.display_unit) == XHSIPreferences.Orientation.RIGHT )
                || ( preferences.get_panel_orientation(this.display_unit) == XHSIPreferences.Orientation.LEFT ) ) {
            this.frame_size.height = this.component_size.width;
            this.frame_size.width = this.component_size.height;
        }

        // calculate coordinates
        this.border_left = this.border;
        this.border_right = this.border;
        this.border_top = this.border;
        this.border_bottom = this.border;
        if ( preferences.get_panel_square(this.display_unit) ) {
            if ( this.frame_size.width > (this.frame_size.height ) ) {
                this.border_left += ( this.frame_size.width - ( this.frame_size.height  ) ) / 2;
                this.border_right = this.border_left;
            } else {
                this.border_top += ( this.frame_size.height  - this.frame_size.width ) / 2;
                this.border_bottom = this.border_top;
            }
        }
        //this.scaling_factor = Math.min( (float)this.frame_size.height, (float)this.frame_size.width ) / 600.0f;
        this.scaling_factor = Math.min( (float)(frame_size.width - border_left - border_right), (float)(frame_size.height - border_top - border_bottom) ) / 600.0f;
        // if the panel gets smaller than 600px, we _should_ try to reduce the size of fonts and images
        this.shrink_scaling_factor = Math.min(1.0f, this.scaling_factor);
        // things like the line thickness can grow when the panel gets bigger than 600px
        this.grow_scaling_factor = Math.max(1.0f, this.scaling_factor);
        // some screen elements like line widths and the border can grow with the power of 2
        if ( preferences.get_panels_locked() ) {
            this.border = preferences.get_panel_border(this.display_unit);
        } else {
            this.border = (int) (INITIAL_BORDER_SIZE * Math.max(1.0f, Math.pow(Math.min((float) this.frame_size.width, (float) this.frame_size.height) / 600.0f, 2)));
        }

        // the rectangle for our instrument
        panel_rect = new Rectangle(
                border_left,
                border_top,
                frame_size.width - border_left - border_right,
                frame_size.height - border_top - border_bottom
            );

        // a nice frame with rounded corners; it will be painted in InstrumentFrame.java
        Area inner_frame = new Area(new RoundRectangle2D.Float(
                border_left,
                border_top,
                frame_size.width - (border_left + border_right),
                frame_size.height - (border_top + border_bottom),
                (int)(30 * this.grow_scaling_factor),
                (int)(30 * this.grow_scaling_factor)));
        instrument_frame = new Area(new Rectangle2D.Float(0, 0, frame_size.width, frame_size.height));
        instrument_frame.subtract(inner_frame);
        // if the cpu can handle it: a double border
        Area outer_frame = new Area(new RoundRectangle2D.Float(
                border_left - border_left / 3,
                border_top - border_top / 3,
                frame_size.width - (border_left + border_right) + border_left / 3 + border_right / 3,
                frame_size.height - (border_top + border_bottom) + border_top / 3 + border_bottom / 3,
                (int)(30 * this.grow_scaling_factor),
                (int)(30 * this.grow_scaling_factor)));
        instrument_outer_frame = new Area(new Rectangle2D.Float(0, 0, frame_size.width, frame_size.height));
        instrument_outer_frame.subtract(outer_frame);

        // fonts
        set_fonts(g2, this.scaling_factor);

    }