alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (metacity-theme-1.xml)

This example Java source code file (metacity-theme-1.xml) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

copyright, foundation, free, general, gnu, inc, license, note, oracle, public, software, this, usa

The metacity-theme-1.xml Java example source code

<?xml version="1.0"?>

<!--
 Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

 This code is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License version 2 only, as
 published by the Free Software Foundation.  Oracle designates this
 particular file as subject to the "Classpath" exception as provided
 by Oracle in the LICENSE file that accompanied this code.

 This code is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 version 2 for more details (a copy is included in the LICENSE file that
 accompanied this code).

 You should have received a copy of the GNU General Public License version
 2 along with this work; if not, write to the Free Software Foundation,
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 or visit www.oracle.com if you need additional information or have any
 questions.
-->

<metacity_theme>
  <info>
    <name>SwingFallbackTheme
    <author>Leif Samuelsson
    <copyright>Â Sun Microsystems, Inc, 2003
    <description>
	  A fallback theme for Swing's GTK Look and Feel, in case no other metacity 
	  theme can be found. Note: This theme is not intended to work with the
	  Metacity window manager, nor to be used for any purpose other than stated
	  here.
     </description>
  </info>

  <frame_geometry name="normal">
    <distance name="left_width" value="5"/>
    <distance name="right_width" value="6"/>
    <distance name="bottom_height" value="6"/>
    <distance name="left_titlebar_edge" value="5"/>
    <distance name="right_titlebar_edge" value="6"/>
    <aspect_ratio name="button" value="1.0"/>
    <distance name="title_vertical_pad" value="0"/>
    <border name="title_border" left="0" right="0" top="3" bottom="3"/>
    <border name="button_border" left="0" right="0" top="3" bottom="3"/>
  </frame_geometry>

  <draw_ops name="button">
    <rectangle color="black" x="0" y="0" width="width-2" height="height-2"/>
  </draw_ops>

  <draw_ops name="button_pressed">
    <rectangle color="black" x="1" y="1" width="width-2" height="height-2"/>
  </draw_ops>

  <frame_style name="normal" geometry="normal">

    <piece position="entire_background">
      <draw_ops>
	  <rectangle color="black" x="0" y="0" width="width-1" height="height-1"/>
	  <rectangle color="black" x="left_width-1" y="1" width="width-left_width-right_width+1" height="height-bottom_height-1"/>
      </draw_ops>
    </piece>

    <piece position="title">
      <draw_ops>
	<title color="black" x="2" y="0"/>
      </draw_ops>
    </piece>

    <piece position="titlebar">
      <draw_ops>
	<gradient type="diagonal" x="1" y="1" width="width-2" height="height-2">
		<color value="shade/gtk:bg[NORMAL]/1.0"/>
		<color value="shade/gtk:bg[NORMAL]/0.9"/>
	</gradient>
	<line color="black" x1="left_width" y1="height-1" x2="width-right_width" y2="height-1"/>
      </draw_ops>
    </piece>

    <button function="close" state="normal">
      <draw_ops>
	<include name="button"/>
	<line color="black" x1="3"       y1="3" x2="width-5" y2="height-5"/>
	<line color="black" x1="width-5" y1="3" x2="3"       y2="height-5"/>
      </draw_ops>
    </button>

    <button function="close" state="pressed">
      <draw_ops>
	<include name="button_pressed"/>
	<line color="black" x1="4"       y1="4" x2="width-4" y2="height-4"/>
	<line color="black" x1="width-4" y1="4" x2="4"       y2="height-4"/>
      </draw_ops>
    </button>

    <button function="minimize" state="normal">
      <draw_ops>
	<include name="button"/>
	<line color="black" x1="4"       y1="height-4" x2="width-5" y2="height-4"/>
      </draw_ops>
    </button>

    <button function="minimize" state="pressed">
      <draw_ops>
	<include name="button_pressed"/>
	<line color="black" x1="5"       y1="height-3" x2="width-4" y2="height-3"/>
      </draw_ops>
    </button>

    <button function="maximize" state="normal">
      <draw_ops>
	<include name="button"/>
	<rectangle color="black" x="3" y="3" width="width-3-5" height="height-3-5"/>
      </draw_ops>
    </button>

    <button function="maximize" state="pressed">
      <draw_ops>
	<include name="button_pressed"/>
	<rectangle color="black" x="4" y="4" width="width-3-5" height="height-3-5"/>
      </draw_ops>
    </button>

    <button function="menu" state="normal">
      <draw_ops>
	<include name="button"/>
      </draw_ops>
    </button>

    <button function="menu" state="pressed">
      <draw_ops>
	<include name="button_pressed"/>
      </draw_ops>
    </button>
  </frame_style>


  <frame_style name="focused" geometry="normal" parent="normal">

    <piece position="entire_background">
      <draw_ops>
	  <rectangle color="black" x="0" y="0" width="width-1" height="height-1"/>
	  <rectangle color="black" x="left_width-1" y="1" width="width-left_width-right_width+1" height="height-bottom_height-1"/>
      </draw_ops>
    </piece>

    <piece position="title">
      <draw_ops>
	<title color="black" x="2" y="((height - title_height) / 2) `max` 0"/>
      </draw_ops>
    </piece>

    <piece position="titlebar">
      <draw_ops>
	<gradient type="diagonal" x="1" y="1" width="width-2" height="height-2">
		<color value="#f0f0f0"/>
		<color value="shade/gtk:bg[NORMAL]/1.0"/>
	</gradient>
	<line color="black" x1="left_width" y1="height-1" x2="width-right_width" y2="height-1"/>
      </draw_ops>
    </piece>

  </frame_style>

  <frame_style_set name="normal">
    <frame focus="yes" state="normal" resize="both" style="focused"/>
    <frame focus="yes" state="maximized" style="focused"/>
    <frame focus="no" state="normal" resize="both" style="normal"/>
    <frame focus="no" state="maximized" style="normal"/>
  </frame_style_set>

</metacity_theme>

Other Java examples (source code examples)

Here is a short list of links related to this Java metacity-theme-1.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.