LilyPond (and deps) + Denemo (the GTK GUI)

pkgname=t1utils
pkgver=1.32
pkgrel=1
pkgdesc="Six free UNIX/Windows command-line tools for dealing with Type 1 fonts."
depends=(gcc)
md5sums=('733892543a5b852b7e5d87bc58117f53')
url="http://www.lcdf.org/~eddietwo/type/#t1utils"
source=(http://www.lcdf.org/~eddietwo/type/$pkgname-$pkgver.tar.gz)
#license=
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make prefix=$startdir/pkg/usr install
# Contributor: thegnu <[email protected]>
pkgname=mftrace
pkgver=1.0.34
pkgrel=1
install="$pkgname.install"
pkgdesc="a small Python program that traces TeX bitmap fonts into scalable PS or TTF fonts"
url="http://www.xs4all.nl/~hanwen/mftrace/"
depends=('potrace' 'python>=2.1' 't1utils' 'tetex')
source=(http://www.cs.uu.nl/~hanwen/mftrace/$pkgname-$pkgver.tar.gz)
md5sums=('c290633ac31c29fbc6a0deeaff97e7e7')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install
after installing mftrace, run:
cd /usr/share/mftrace/
import filelib
you need imagemagick for that (and last version has a problem that is bugreported)
Now sit back and relax.. [f**k bill]
coz this is going to take a lot of time in fonts
#Contributor: thegnu <[email protected]>
pkgname=ec-fonts-mftraced
pkgver=1.0.1
pkgrel=1
pkgdesc="a font package required by lilypond"
url="http://www.lilypond.org/"
depends=()
source=(http://lilypond.org/download/fonts/$pkgname-$pkgver.tar.gz)
md5sums=('1b4bf2634fbf680b7fa874e8208e0e54')
build() {
cd $startdir/src/$pkgname-$pkgver
make DESTDIR=$stardir/pkg
make DESTDIR=$startdir/pkg install
pkgname=lilypond
pkgver=2.2.6
pkgrel=1
pkgdesc="an automated engraving system that fomats beautiful music notation"
url="http://www.lilypond.org/"
depends=('ghostscript' 'tetex' 'ec-fonts-mftraced' 'guile>=1.6.0')
makedepends=('mftrace>=1.0.17' 'guile>=1.6.0' 'tetex' 'bison>=1.25' 'python>=2.1' 'texinfo')
source=(http://lilypond.org/download/v2.2/$pkgname-$pkgver.tar.gz)
md5sum=('c379905b53973cc314415340dd017c77')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install
# I'm not sure the next step actually puts the docs in $startdir/pkg
make DESTDIR=$startdir/pkg web
Note to thegnu I've added the missing dep: "texinfo"
and last but not least [don't tell me you don't want GUI for lilypond 's system]
# Contributor: Nikos Kouremenos <[email protected]>
pkgname=denemo
pkgver=0.7.2a
pkgrel=1
pkgdesc="Denemo is a unique score editor which exports notation to LilyPond and
ABC music formats."
depends=(flex bison gtk2 libxml2 lilypond)
md5sums=('2d57e4d660e13eb6e476104c788046af')
url="http://denemo.sourceforge.net/"
source=(http://heanet.dl.sourceforge.net/sourceforge/denemo/denemo-0.7.2a.tar.gz)
#license=
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr --enable-gtk2 --enable-alsa --with-plugins=analysis
make || return 1
make prefix=$startdir/pkg/usr install
DENEMO WILL FAIL COMPILING [I'm guess gcc 3.4]
with
exportmudela.cpp: In function `void lily_write_out(void*, GList*, lily_output_type)':
exportmudela.cpp:183: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:194: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:208: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:216: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:224: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:230: error: ISO C++ forbids cast to non-reference type used as lvalue
exportmudela.cpp:232: error: ISO C++ forbids cast to non-reference type used as lvalue
I didn't try cvs, anyone who has the courage go on and try it
and because this is not Gentoo, http://members.hellug.gr/nkour/files/archlinux/
I really hope it works for you

Good work zeppelin!  So you have a working lilypond install now?
The mftrace.install was a failed early attempt to get around manually having to run:
cd /usr/share/mftrace/
import filelib
It should just be left out of the PKGBUILD:
# Contributor: thegnu <[email protected]>
pkgname=mftrace
pkgver=1.0.34
pkgrel=1
pkgdesc="a small Python program that traces TeX bitmap fonts into scalable PS or TTF fonts"
url="http://www.xs4all.nl/~hanwen/mftrace/"
depends=('potrace' 'python>=2.1' 't1utils' 'tetex')
source=(http://www.cs.uu.nl/~hanwen/mftrace/$pkgname-$pkgver.tar.gz)
md5sums=('c290633ac31c29fbc6a0deeaff97e7e7')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install

Similar Messages

  • Bambus - A small and simple GTK Gui to change Wallpapers using feh,...

    It is a old project, which I wrote a year ago.
    Bambus - A small and simple GTK Gui to change Wallpapers using feh, Esetroot, hsetroot, habak or any other command tool.
    Aur package: bambus
    To restore a Wallpaper at a WM start-up (Openbox, Awesome,...) execute the command
    bambus -restore
    To restore a Wallpaper randomly execute
    bambus -any
    To restore Wallpapers in a special order execute
    bambus -each
    Screenshots:
    Last edited by ying (2010-11-10 06:35:06)

    Hey thx a lot for your posts.
    @ApotheoZ: Hmm I don't know where I got them from(Take a look at wallbase.com). But I'll load it up for you.
    Last edited by ying (2010-11-10 16:36:26)

  • Can I use SubPanels to display and run multiple executables from the same GUI?

    I have two Labview executables that performs some A/D I/O, each using an independent USB-6008.  I would like to run both of these executables from a single UI.  Is this possible usin SubPanels?  Or some other method?
    I found KB regarding exe's and VI Server but can't seem to get the suggested workarounds implemented.
    http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C?OpenDocument
    I am using Labview2009
    Thanks
    Dan
    Solved!
    Go to Solution.

    DBerry wrote:
    No, of course I am not sure yet.  I have only begun testing this method. 
    Not sharing common hardware (separate USM-6008s).
    Here is the whole picture:
    I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C
    The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.
    So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.
    If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.
    Thanks
    Dan
    When I am designing apps of the type you described I have kept the ned goal in mind from the begining since of the issue you are mentioning. I also don't want to tell you to throw it all away and start over. So with that in mind I have been looking at your posts and only offering the least destrutive ideas first. With that in mind I would like to invite yo uto look at the code i posted in this thread (reply #18 has a zip).
    That code shows how to realize un-dockable GUI regions but it passes the ref of the top level VI to a reentrant VI it instanciate for each undockable region. It may have enough hints and technique to give you some ideas that will work for you.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I dynamicall​y read a file and show/plot the data in the GUI?

    Hi, everyone,
    I hope to implement a VI with the following function:
    Usually, when we "read a file" in VI and then show the data in the Waveform Chart or other display GUI, the VI will first read and record all of the data from the file and then show them simultaneously. Now, I want to implement a VI, which could read  the data from a file and display it in a time series. That is, I can define a "sampling rate" or "reading rate", like 100 data points / second,  then the data points could be correspondingly shown in Waveform Chart one by one as the time moves on. The key purpose is to simulate a real-time data collection module using an existing file.
    I don't know how to implement this function. Any suggestion and solution are really appreciated.
    Thanks.
    Zhanpeng

    Heres the same effect, just a different approach :
    The code in the red box was used to create data that you would be getting from a file.
    What you could do is (shown above) :
    - Read all of the data
    - Index only one value at a time, and set the 'sampling rate' using a wait in a while loop.
    - Build an array using this value, which will simulate collecting data in real time.
    - I used an array of the iterations as X-values, because they coincidentally correspond to # seconds in my example
    - I then bundled the time array (xvalues) with the values from your file (yvalues)
    - Send that bundle to an XY graph
    That should work, though you could implement some different logic for different sampling rates.
    Let me know if you need a hand with that.
    Message Edited by Cory K on 02-26-2009 11:36 AM
    Cory K
    Attachments:
    graph from file.PNG ‏10 KB

  • Stop and start the system via the SAP GUI

    ........ although I don't know the answer!
    We have SAP running on an iSeries/DB2 format.
    And we of course have stopped and started our SAP systems many times before via an iSeries screen.
    One thing we have never had to do, is stop and start the system via the SAP GUI.
    Is this possible? If so, how is it done?
    Surprisingly difficult to find a solution online.
    Edited by: Juan Reyes on Aug 10, 2010 11:10 AM

    Paui,
    You can also do a soft shutdown, which waits till the active users/sessions are logged out (Draing out the sesstions) and no more new users are allowed to login during that time.
    Goto SM51, select the instace/server you want to stop then menu --> Goto --> Server Name --> Administration --> Shut Down Server (soft).
    Here you can also select a hard shutdown if the situation demands by following the same menu path.
    Even though your question is answered but I still wanted to update you the options to select.
    -Mahesh

  • SAP MMC not showing SID after sap gui install and reboot of the server

    Hi,  after SAPGUI 7.10 install on our server and rebooting of the same,  SAP MMC says  u201CMMC could not create the snap-inu201D.
    We are desperately trying to find a solution.  We did the following:  Uninstalled the gui.
    1) Uninstalled the SAPMMC snap-in
    2) Re-installed it with the sapmmc_2-20005866.msi.
    3) This automatically created all the required dlls..especially the main ones ..sapmmc.dll,  sapstartsrv.exe in c:\WINDOWS\system32
    4) Copied librfc32.dll from a working system  to c:\WINDOWS\system32 of the system that is having issues
    5) Did the registry setup, by doing REGSVR32 sapmmc.dll, and further did sapstartsrv   -t  and re-created the service with the following parameters:
        <SID>
        01
       START_D*_hostname
       .\SAPService<SID>
       Password:*****
    6) All the services are up and running.
    7) Also did a re-boot, just to check if the registry update needed it, for the changes to be active.
    Still facing the same issue  "SAP MMC could not create the snap-in"
    Any input is  appreciated.
    Thanks and regards,
    RS.

    Hi,
    Check your "Input locale" might not be compatible with "System locale".
    Let us know if this information is useful to you.
    with regards,
    Parin Hariyani

  • Use a gtk theme for one app and another for the whole system??

    I would like to know if is it possible to use a theme for one application and use another for the remaining of the system? I use OpenBox and I change themes with Lxappearance...
    Thanks,

    Uhh, thanks mauryck for the question and anonymous_user for the answer! I use a very slow gtk theme, and one program suffer from it, but this theme is so beautiful so I dont like to change. Never though about this solution, use a different theme only for this program!
    Sometimes the solution is so simple...

  • Killing the gui and droping into the kernel

    is there a key combo i can hit in the finder or anywhere in the gui for that matter that will kill all services but the kernel and drop me into the kernel?
    from where i could run unix commands and even restart the gui if my heart saw fit?

    i would want to be able to do it so that if i install a program and it requires a restart
    What applications are you installing that require a restart?
    Most applications shouldn't need it. If it does need a restart it would only be because it's installing some kind of kernel extension, which still wouldn't be loaded by a restart of the GUI.

  • "securely" use one ethernet interface for WAN and other for the LAN

    I am reconfiguring our dual 2.7 Intel Xserve running MacOSXServer 10.5.4, and had a question.
    Is it possible (or advisable) to use en0 to perform LAN services, and then configure en1 to only allow access to very limited service. VPN, FTP, CALDAV and later Mail.
    I imagine that this is possible via a firewall configuration, but first I do not know how to specify interface in addition to ports, and second I don't know how advisable this would be.
    Currently I have a DSL package from ATT with 5 static IP addresses. I have an Airport Extreme set up as one of those addresses providing DHCP and NAT to the LAN. I am using the LAN ports on the back of that to bridge my three switches (2 managed [clients and oce print server 100 base-T] and 1 unmanaged [ laser printers and copier 10 base-T]).
    I have the LAN based on 192.168.0.x, with the Xserve at 192.168.0.5. I have DNS configured and working (Thank you Antonio Rocco)
    I have 20 LAN clients, 18 mac 1 PC and one PC via Parallels. I will have no more than 1 or 2 WAN clients at any one time
    I provide AFP, SMB, Directory Services currently. As part of the reconfigure, I desire to take better advantage of the collaboration tools to provide wikis and CALDAV services. I also want to allow our employees to publish their individual calendars, so that they can subscribe to them at home, or vice versa.
    I would like to configure VPN, one for me to access configurations when I am away using Remote Desktop (I have used command line to some extent, but still feel more comfortable with the GUI tools) and second for limited access to content for certain users.
    It would also be very helpful for us to have a FTP site. It is unnecessary for this the be a FQDN service, sending the IP address is perfectly acceptable as we only use a service like this 10-15 times a year.
    (Related but unimportant in the grand scheme, is there a way to generate a link to the FTP server that you could email that not only is a link, but also a temporary username and password?)
    Thank you in advance,
    Ion Webster

    First, I missed a zero in the network speeds, I have two managed GbE switches that have all of the GbE capable machines connected to them, and an unmanaged GbE switch that has all the 10 or 100Base-T connections. My apologies for the mistake. That was one of the reasons I went with the GbE capable Airport to bridge the switches.
    Ok, I had been leaning towards a separate hardware firewall, but here is also where there is a hole in my knowledge. Do I need to look at something like the Linksys RVS4000 which bills itself as a +"4-Port Gigabit Security Router with VPN. Secure, smart Gigabit networking for growing business"+ I would like easy configuration, as I take care of these systems in addition to my job, rather than full time. This will be the first time I have set up a VPN connection, so even though I have spent a lot of time researching the manuals, and reading Schoun Regan (Apple Training Series) I don't have real world experience here. So if I buy more hardware, I want it to be the product that will provide the protection, and also allow me to configure it so that I can get these services running. All my VPN clients are running Macs, most on an AIrport connection and have their IP ranges in the 10.0.1.x range. all but one is on OS 10.5.x so I have a fairly homogeneous set of machines to make work together.
    I will review the links you provided regarding static routing, but I do believe the hardware solution is a better one, and wish to pursue it, for all the reasons you give, and that in the brief perusal of the links, it is more than I want to tackle.
    As far as FTP vs sFTP, I have no preference. I simply want a way to have online storage for transfer of large files on occasion. Ideally I want a folder, or a series of folders that are accessible for my LAN users to put items in and take them out, and for my (s)FTP users to do the same
    So long story short, the hardware solution I would like to purchase, I need to be able to do the following:
    VPN connections for content access and ARD access ( knew about and will ensure differing IP ranges)
    (s)FTP
    Calendar publishing
    mail(at a later time)
    Thank you for your help thus far.
    Ion Webster

  • How do I install a language XPI globally and make it the default language?

    I am using Firefox on unices and various Linux distributions (the less common ones). Installing Firefox is easy, but it is always in English. I get most of my interfaces (gnome, libreoffice, gimp, etc) in my preferred translation simply by setting the proper locale (export LANG=xy_XY.UTF-8) before starting Xorg. I found and downloaded my preferred language pack for firefox, which comes in an XPI archive. Opening that XPI file in Firefox (via an URL of file:///path/to/file/langpack.xpi) works smoothly, the translation gets installed under the user's own profile and it shows up in the add-ons (under the new category: Languages). Unfortunately, I still see no way in Firefox preferences to set this added translation as the default. Firefox still starts with the English interface. On SeaMonkey, there is a combobox on the Appearance panel that allows me to select the language of the interface from the list of installed/available languages. I cannot find such option on the panels of Firefox. So far, I had to install a language-changer add-on to be able to set the interface to my native locale. Even though my users never need to switch to any other locales.
    Q1., Once a language xpi is installed, how do I set the interface to use that language?
    Q2., How do I install the language xpi and make it the system-wide default, so that all my users see Firefox starting with the native (non-English) interface?
    I found a handful of description for Q2, but they appear to be outdated and do not work. These include the -install-global-extension argument to Firefox, placing the xpi file as it was downloaded into the "extensions" folder, placing the xpi file renamed to the extension ID into the "extensions" folder, unzipping the contents of the xpi into a subfolder of the "extensions" folder named as the extension ID. Please note, these attempts might have failed because I placed the extension NOT where it was supposed to go. The instructions refer to the global extension folder as <installation folder>/extensions, but on my system no such folder exists. Firefox seems to get installed into /usr/local/lib/firefox and there is no "extensions" subfolder there in. However, there is a "browser/extensions" subfolder, but placing my XPI there did not trigger any effect. Also, I manually created the "extensions" subfolder in /usr/local/lib/firefox and moved the xpi there (on various names, unzipped and in a whole) without the expected result.
    Any suggestion is very much appreciated!
    My goal is to install the firefox package, then run something from the command line resulting the non-English translation in the downloaded XPI becoming the system-wide default for all users. A step forward would be to know for certain where that "extensions" folder must be on my specific OS. How do I query that?

    Excellent. These guides got me as far as installing my preferred language pack, which gets added to the add-ons automatically (assuming the user says yes to the appearing question when Firefox is started).
    However, the GUI does not change unless the user enters "about:config" and changes the locale.
    Is there a way to do this from the command line? I mean, changing the locale settings.
    And preferrably for all users. So even when new users get added and they start Firefox the first time, they see it appearing with the preferred locale and not in English.

  • My iPod Touch 4g is stuck in Apple Mode after attempting to install the Siri GUI. What can I do to restore?

    I have an 8GB, 4g iPod Touch. It has the lastest iOS on it (iOS 5). Yesterday I used Cydia to jailbreak it. I had no idea what I was doing but I followed step-by-step instuctions and it worked! Needless to say, I've messed up several times (while rebooting) and I am now a Pro!! Lol. Anyway, today, I was installing the Siri GUI software onto the iPod. It was a long and drawn out process and I'm assuming that I did it wrong. It was stuck in the black screen with the little (loading) loop. It sat there for about 30 minutes. Sometimes the loop would spin, sometimes it would just be there. Finally, I pushed the Home and Power buttons at the same time and I got the Apple Logo. And this is where I am stuck now.
    I have tried a number of things, such as:
    * Holding down the power button and hoping that the "slide to power off" screen would come up. No response.
    * Holding down the Power AND Home buttons at the same time thinking the "connect to iTunes screen" would come up. The screen just goes black and then the Apple Logo comes back up.
    * I've tried connecting to iTunes but it doesn't recognize my device. My laptop doesn't even "ding" when I plug it in. I've tried changing the USB port that I have the cord plugged into. I've tried uninstalling and reinstalling iTunes. I've restarted my computer. I've went through the Apple Support troubleshooter and dealt with the "third party conflicts".
    I'm not sure what else to do here. I realize that I probably should not be downloading, jailbreaking and attempting to 'mod' my iPod- I don't even know what DFU mode, GUI or most of the other hi-tech words mean. I am just pretty good at following directions, lol.
    Can someone please help??
    I'm using a Windows 7 OS on my laptop, not MAC.

    I suggest try getting it back to your stock iOS and forget about jailbreaking.
    http://support.apple.com/kb/TS1538
    Try a manual install (using DFU Mode), as outlined in the link below.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

  • Overlay Images and Shapes on the same canvas

    The example copde below was taken from: http://math.hws.edu/eck/cs124/javanotes3/source/
    Is it possible to update the code so that images (jpg,gif) can be added as well as shapes?
    Any help with this is much appreciated.
        The ShapeDraw applet lets the user add small colored shapes to
        a drawing area and then drag them around.  The shapes are rectangles,
        ovals, and roundrects.  The user adds a shape to the canvas by
        clicking on a button.  The shape is added at the upper left corner
        of the canvas.  The color of the shape is given by the current
        setting of a pop-up menu.  The user can drag the shapes with the
        mouse.  Ordinarily, the shapes maintain a given back-to-front order.
        However, if the user shift-clicks on a shape, that shape will be
        brought to the front.
        A menu can be popped up on a shape (by right-clicking or performing
        some othe platform-dependent action).  This menu allows the user
        to change the size and color of a shape.  It is also possible to
        delete the shape and to bring it to the front.
        This file defines the applet class plus several other classes used
        by the applet, namely:  ShapeCanvas, Shape, RectShape, OvalShape,
        and RoundRectShape.
        David Eck
        July 28,  1998
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    import java.util.Vector;
    public class ShapeDrawWithMenu extends Applet {
       public void init() { 
            // Set up the applet's GUI.  It consists of a canvas, or drawing area,
            // plus a row of controls below the canvas.  The controls include three
            // buttons which are used to add shapes to the canvas and a Choice menu
            // that is used to select the color used for a shape when it is created.
            // The canvas is set as the "listener" for these controls so that it can
            // respond to the user's actions.  (The pop-up menu is created by the canvas.)
          setBackground(Color.lightGray);
          ShapeCanvas canvas = new ShapeCanvas();  // create the canvas
          Choice colorChoice = new Choice();  // color choice menu
          colorChoice.add("Red");
          colorChoice.add("Green");
          colorChoice.add("Blue");
          colorChoice.add("Cyan");
          colorChoice.add("Magenta");
          colorChoice.add("Yellow");
          colorChoice.add("Black");
          colorChoice.add("White");
          colorChoice.addItemListener(canvas);
          Button rectButton = new Button("Rect");    // buttons for adding shapes
          rectButton.addActionListener(canvas);
          Button ovalButton = new Button("Oval");
          ovalButton.addActionListener(canvas);
          Button roundRectButton = new Button("RoundRect");
          roundRectButton.addActionListener(canvas);
          Panel bottom = new Panel();   // a Panel to hold the control buttons
          bottom.setLayout(new GridLayout(1,4,3,3));
          bottom.add(rectButton);
          bottom.add(ovalButton);
          bottom.add(roundRectButton);
          bottom.add(colorChoice);
          setLayout(new BorderLayout(3,3));
          add("Center",canvas);              // add canvas and controls to the applet
          add("South",bottom);
       public Insets getInsets() {
            // Says how much space to leave between the edges of the applet and the
            // components in the applet.
          return new Insets(3,3,3,3);
    }  // end class ShapeDraw
    class ShapeCanvas extends Canvas implements ActionListener, ItemListener,
                                                MouseListener, MouseMotionListener {
          // This class represents a canvas that can display colored shapes and
          // let the user drag them around.  It uses an off-screen images to
          // make the dragging look as smooth as possible.  A pop-up menu is
          // added to the canvas that can be used to performa certain actions
          // on the shapes;
       Image offScreenCanvas = null;   // off-screen image used for double buffering
       Graphics offScreenGraphics;     // graphics context for drawing to offScreenCanvas
       Vector shapes = new Vector();   // holds a list of the shapes that are displayed on the canvas
       Color currentColor = Color.red; // current color; when a shape is created, this is its color
       ShapeCanvas() {
            // Constructor: set background color to white, set up listeners to respond to mouse actions,
            //              and set up the pop-up menu
          setBackground(Color.white);
          addMouseListener(this);
          addMouseMotionListener(this);
          popup = new PopupMenu();
          popup.add("Red");
          popup.add("Green");
          popup.add("Blue");
          popup.add("Cyan");
          popup.add("Magenta");
          popup.add("Yellow");
          popup.add("Black");
          popup.add("White");
          popup.addSeparator();
          popup.add("Big");
          popup.add("Medium");
          popup.add("Small");
          popup.addSeparator();
          popup.add("Delete");
          popup.add("Bring To Front");
          add(popup);
          popup.addActionListener(this);
       } // end construtor
       synchronized public void paint(Graphics g) {
            // In the paint method, everything is drawn to an off-screen canvas, and then
            // that canvas is copied onto the screen.
          makeOffScreenCanvas();
          g.drawImage(offScreenCanvas,0,0,this);
       public void update(Graphics g) {
            // Update method is called when canvas is to be redrawn.
            // Just call the paint method.
          paint(g);
       void makeOffScreenCanvas() {
             // Erase the off-screen canvas and redraw all the shapes in the list.
             // (First, if canvas has not yet been created, then create it.)
          if (offScreenCanvas == null) {
             offScreenCanvas = createImage(getSize().width,getSize().height);
             offScreenGraphics = offScreenCanvas.getGraphics();
          offScreenGraphics.setColor(getBackground());
          offScreenGraphics.fillRect(0,0,getSize().width,getSize().height);
          int top = shapes.size();
          for (int i = 0; i < top; i++) {
             Shape s = (Shape)shapes.elementAt(i);
             s.draw(offScreenGraphics);
       public void itemStateChanged(ItemEvent evt) {
              // This is called to respond to item events.  Such events
              // can only be sent by the color choice menu,
              // so respond by setting the current color according to
              // the selected item in that menu.
          Choice colorChoice = (Choice)evt.getItemSelectable();
          switch (colorChoice.getSelectedIndex()) {
             case 0: currentColor = Color.red;     break;
             case 1: currentColor = Color.green;   break;
             case 2: currentColor = Color.blue;    break;
             case 3: currentColor = Color.cyan;    break;
             case 4: currentColor = Color.magenta; break;
             case 5: currentColor = Color.yellow;  break;
             case 6: currentColor = Color.black;   break;
             case 7: currentColor = Color.white;   break;
       public void actionPerformed(ActionEvent evt) {
              // Called to respond to action events.  The three shape-adding
              // buttons have been set up to send action events to this canvas.
              // Respond by adding the appropriate shape to the canvas.  This
              // also be a command from a pop-up menu.
          String command = evt.getActionCommand();
          if (command.equals("Rect"))
             addShape(new RectShape());
          else if (command.equals("Oval"))
             addShape(new OvalShape());
          else if (command.equals("RoundRect"))
             addShape(new RoundRectShape());
          else
             doPopupMenuCommand(command);
       synchronized void addShape(Shape shape) {
              // Add the shape to the canvas, and set its size/position and color.
              // The shape is added at the top-left corner, with size 50-by-30.
              // Then redraw the canvas to show the newly added shape.
          shape.setColor(currentColor);
          shape.reshape(3,3,50,30);
          shapes.addElement(shape);
          repaint();
       // ------------ This rest of the class implements dragging and the pop-up menu ---------------------
       PopupMenu popup;
       Shape selectedShape = null;     // This is null unless a menu has been popped up on this shape.
       Shape draggedShape = null;      // This is null unless a shape has been selected for dragging.
       int prevDragX;  // During dragging, these record the x and y coordinates of the
       int prevDragY;  //    previous position of the mouse.
       Shape clickedShape(int x, int y) {
             // Find the frontmost shape at coordinates (x,y); return null if there is none.
          for ( int i = shapes.size() - 1; i >= 0; i-- ) {  // check shapes from front to back
             Shape s = (Shape)shapes.elementAt(i);
             if (s.containsPoint(x,y))
                return s;
          return null;
       void doPopupMenuCommand(String command) {
             // Handle a command from the pop-up menu.
          if (selectedShape == null)  // should be impossible
             return;
          if (command.equals("Red"))
             selectedShape.setColor(Color.red);
          else if (command.equals("Green"))
             selectedShape.setColor(Color.green);
          else if (command.equals("Blue"))
             selectedShape.setColor(Color.blue);
          else if (command.equals("Cyan"))
             selectedShape.setColor(Color.cyan);
          else if (command.equals("Magenta"))
             selectedShape.setColor(Color.magenta);
          else if (command.equals("Yellow"))
             selectedShape.setColor(Color.yellow);
          else if (command.equals("Black"))
             selectedShape.setColor(Color.black);
          else if (command.equals("White"))
             selectedShape.setColor(Color.white);
          else if (command.equals("Big"))
             selectedShape.resize(75,45);
          else if (command.equals("Medium"))
             selectedShape.resize(50,30);
          else if (command.equals("Small"))
             selectedShape.resize(25,15);
          else if (command.equals("Delete"))
             shapes.removeElement(selectedShape);
          else if (command.equals("Bring To Front")) {
             shapes.removeElement(selectedShape);
             shapes.addElement(selectedShape);
          repaint();
       synchronized public void mousePressed(MouseEvent evt) {
             // User has pressed the mouse.  Find the shape that the user has clicked on, if
             // any.  If there is a shape at the position when the mouse was clicked, then
             // start dragging it.  If the user was holding down the shift key, then bring
             // the dragged shape to the front, in front of all the other shapes.
          int x = evt.getX();  // x-coordinate of point where mouse was clicked
          int y = evt.getY();  // y-coordinate of point
          if (evt.isPopupTrigger()) {            // If this is a pop-up menu event that
             selectedShape = clickedShape(x,y);  // occurred over a shape, record which shape
             if (selectedShape != null)          // it is and show the menu.
                popup.show(this,x,y);
          else {
             draggedShape = clickedShape(x,y);
             if (draggedShape != null) {
                prevDragX = x;
                prevDragY = y;
                if (evt.isShiftDown()) {                 // Bring the shape to the front by moving it to
                   shapes.removeElement(draggedShape);  //       the end of the list of shapes.
                   shapes.addElement(draggedShape);
                   repaint();  // repaint canvas to show shape in front of other shapes
       synchronized public void mouseDragged(MouseEvent evt) {
              // User has moved the mouse.  Move the dragged shape by the same amount.
          if (draggedShape != null) {
             int x = evt.getX();
             int y = evt.getY();
             draggedShape.moveBy(x - prevDragX, y - prevDragY);
             prevDragX = x;
             prevDragY = y;
             repaint();      // redraw canvas to show shape in new position
       synchronized public void mouseReleased(MouseEvent evt) {
              // User has released the mouse.  Move the dragged shape, then set
              // shapeBeingDragged to null to indicate that dragging is over.
              // If the shape lies completely outside the canvas, remove it
              // from the list of shapes (since there is no way to ever move
              // it back onscreen).
          int x = evt.getX();
          int y = evt.getY();
          if (draggedShape != null) {
             draggedShape.moveBy(x - prevDragX, y - prevDragY);
             if ( draggedShape.left >= getSize().width || draggedShape.top >= getSize().height ||
                     draggedShape.left + draggedShape.width < 0 ||
                     draggedShape.top + draggedShape.height < 0 ) {  // shape is off-screen
                shapes.removeElement(draggedShape);  // remove shape from list of shapes
             draggedShape = null;
             repaint();
          else if (evt.isPopupTrigger()) {        // If this is a pop-up menu event that
             selectedShape = clickedShape(x,y);   // occurred over a shape, record the
             if (selectedShape != null)           // shape and show the menu.
                popup.show(this,x,y);
       public void mouseEntered(MouseEvent evt) { }   // Other methods required for MouseListener and
       public void mouseExited(MouseEvent evt) { }    //              MouseMotionListener interfaces.
       public void mouseMoved(MouseEvent evt) { }
       public void mouseClicked(MouseEvent evt) { }
    }  // end class ShapeCanvas
    abstract class Shape {
          // A class representing shapes that can be displayed on a ShapeCanvas.
          // The subclasses of this class represent particular types of shapes.
          // When a shape is first constucted, it has height and width zero
          // and a default color of white.
       int left, top;      // Position of top left corner of rectangle that bounds this shape.
       int width, height;  // Size of the bounding rectangle.
       Color color = Color.white;  // Color of this shape.
       void reshape(int left, int top, int width, int height) {
             // Set the position and size of this shape.
          this.left = left;
          this.top = top;
          this.width = width;
          this.height = height;
       void resize(int width,int height) {
             // Set the size without changing the position
          this.width = width;
          this.height = height;
       void moveTo(int x, int y) {
              // Move upper left corner to the point (x,y)
          this.left = x;
          this.top = y;
       void moveBy(int dx, int dy) {
              // Move the shape by dx pixels horizontally and dy pixels veritcally
              // (by changing the position of the top-left corner of the shape).
          left += dx;
          top += dy;
       void setColor(Color color) {
              // Set the color of this shape
          this.color = color;
       boolean containsPoint(int x, int y) {
             // Check whether the shape contains the point (x,y).
             // By default, this just checks whether (x,y) is inside the
             // rectangle that bounds the shape.  This method should be
             // overridden by a subclass if the default behaviour is not
             // appropriate for the subclass.
          if (x >= left && x < left+width && y >= top && y < top+height)
             return true;
          else
             return false;
       abstract void draw(Graphics g); 
             // Draw the shape in the graphics context g.
             // This must be overriden in any concrete subclass.
    }  // end of class Shape
    class RectShape extends Shape {
          // This class represents rectangle shapes.
       void draw(Graphics g) {
          g.setColor(color);
          g.fillRect(left,top,width,height);
          g.setColor(Color.black);
          g.drawRect(left,top,width,height);
    class OvalShape extends Shape {
           // This class represents oval shapes.
       void draw(Graphics g) {
          g.setColor(color);
          g.fillOval(left,top,width,height);
          g.setColor(Color.black);
          g.drawOval(left,top,width,height);
       boolean containsPoint(int x, int y) {
             // Check whether (x,y) is inside this oval, using the
             // mathematical equation of an ellipse.
          double rx = width/2.0;   // horizontal radius of ellipse
          double ry = height/2.0;  // vertical radius of ellipse
          double cx = left + rx;   // x-coord of center of ellipse
          double cy = top + ry;    // y-coord of center of ellipse
          if ( (ry*(x-cx))*(ry*(x-cx)) + (rx*(y-cy))*(rx*(y-cy)) <= rx*rx*ry*ry )
             return true;
          else
            return false;
    class RoundRectShape extends Shape {
           // This class represents rectangle shapes with rounded corners.
           // (Note that it uses the inherited version of the
           // containsPoint(x,y) method, even though that is not perfectly
           // accurate when (x,y) is near one of the corners.)
       void draw(Graphics g) {
          g.setColor(color);
          g.fillRoundRect(left,top,width,height,width/3,height/3);
          g.setColor(Color.black);
          g.drawRoundRect(left,top,width,height,width/3,height/3);
    }

    Manveer-Singh
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this 3 year old thread now.
    db
    edit You have earlier been advised not to post in old dead threads.
    [http://forums.sun.com/thread.jspa?threadID=354443]
    Continuing to ignore this advice will render your account liable to be blocked.
    Edited by: Darryl.Burke

  • Error in fetching the data from textfield and inserting to the database..

    I'm using Java Swing as front end and MySQL as backend using the netbeans ide..I am trying to fetch the data from the textfiled in the form and insert to the database table.i've skipped the generated code..In the following code i get the erro cannot find symbol "stmt" in the actionPerformed method..
    mport java.awt.event.*;
    import java.sql.*;
    public class BarcodeReader extends JFrame implements ActionListener {
    public BarcodeReader() {
    initComponents();
    nb.addActionListener(this);
    public void jdbcConnect(){
    Connection con=null;
    String url = "jdbc:mysql://localhost:3306/";
    String db = "mynewdatabase";
    String driver = "com.mysql.jdbc.Driver";
    String user = "usrname";
    String pass = "pwd";
    try{
    String s=newtxt.getText();
    con=DriverManager.getConnection(url + db, user, pass);
    Statement stmt=con.createStatement();
    Class.forName(driver);
    public void actionPerformed(ActionEvent e){
    try{
    jdbcConnect();
    stmt.executeUpdate("INSERT into machine(mname) values '"+jTextField1.getText()+"'");
    }}catch (Exception ex) {
    System.out.println(ex);
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new BarcodeReader().setVisible(true);
    }

    There are far too many errors to try and clear.
    For one, the exception references the actionPerformed method (according to your text), so why is that not shown here?
    For another you are performing, possible time-consuming, actions, and even worse IO actions, on the event thread, which is a huge no-no.
    You are not closeing your resources properly, if at all, which is another huge no-no.
    You are completely mixing your "view" (the gui), and your "model" (the data related classes), which is another huge no-no.
    etc, etc, etc.

  • Using the SAP GUI from the NW2004s SneakPreview Download

    Hello,
    does anyone else have major problems with the SAPGUI from the NW2004 SneakPreview download page?
    Im getting a runtime error when logging on:
    Runtime Errors         MESSAGE_TYPE_X                                                                 
    Date and Time          24.12.2005 00:34:11                                                                               
    Short text                                                                               
    The current application triggered a termination with a short dump.                                                                               
    What happened?                                                                               
    The current application program detected a situation which really                                
         should not occur. Therefore, a termination with a short dump was                                 
         triggered on purpose by the key word MESSAGE (type X).                                                                               
    Error analysis                                                                               
    Short text of error message:                                                                     
         Control Framework : Error processing control                                                     
         Technical information about the message:                                                         
         Message classe...... "CNDP"                                                                      
         Number.............. 006                                                                               
    Variable 1.......... " "                                                                               
    Variable 2.......... " "                                                                               
    Variable 3.......... " "                                                                               
    Variable 4.......... " "                                                                               
    Trigger Location of Runtime Error                                                                    
         Program                                 CL_GUI_CFW====================CP                         
         Include                                 CL_GUI_CFW====================CM002                      
         Row                                     23                                                       
         Module type                             (METHOD)                                                 
         Module Name                             FLUSH                                                                               

    Hello Rich,
    the sap gui from the NW2004s SneakPreview page is on patchlevel 8. The problem is when i use the latest sap gui from the service marketplace (full install!) i cant event call the gui. Getting a error when doubleclicking on the SAP Gui icon.
    'The procedure entry point 'RfcResetTraceDir' could not be located in the dynamic link library 'LIBRFC32.dll' .'
    So actually since i installed the NW2004s on my local notebook the only sap gui "working" (at least i can call it) is the one from the NW2004s Sneakpreview page but im getting this error mentioned here on all systems! not only on the NW2004s system
    regards,
    Markus

  • ACS IS WORKING, BUT NOT THE WEB GUI

    I have an ACS ver 5.4.0.46.7 running on an applicance, ACS-1121-K9. After rebooting a Win2008-controller it stopped working and someone in my Department rebooted the ACS. It looks like the authentications are working now, but I can't Access the web gui. It responds to ping and ssh. I did a show acs-config-web-Interface and the view-Interface was disabled, I enabled it but still it isn't working:
    TBGACS02/admin# show acs-config-web-interface
    migration interface is disabled
    ucp interface is disabled
    view interface is enabled
    rest interface is disabled
    TBGACS02/admin# show application status acs
    ACS role: PRIMARY
    Process 'database'                  running
    Process 'management'                running (HTTP is nonresponsive)
    Process 'runtime'                   not monitored
    Process 'adclient'                  running
    Process 'ntpd'                      running
    Process 'view-database'             running
    Process 'view-jobmanager'           Execution failed
    Process 'view-alertmanager'         running
    Process 'view-collector'            running
    Process 'view-logprocessor'         running
    I could try to reboot again but I'd prefer not if possible..

    As a basic troubleshooting we can restart the services or server completely. However if that doesn't help, then we can also review the size of /opt to ensure accumulation of view database is not causing this issue. From the logging perspective we can look at management and ade/ADE logs. 
    In Majority of cases customer reset the application configuration and restore the last good backup. This always help them resolve the issue quickly without going through the troubleshooting process. 
    HTH
    -Jatin

Maybe you are looking for