Border who is not a border

Hi,
I want to create a border which don't surround the component. The border should be inside the component.
The problem is, that i got a component who don't got much space do display other components so a border would waste more space.
My idea was to override the paintComponent method
of the component who should render the border.
This works ... but is it really slow ;(
Here is the code of the paintComponent method
// size of the border
int BORDER_SIZE = 3;
// for clipping
Area a1, a2;
// width , height
int w, h;
public void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
      g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                          RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
      w = getWidth();
      h = getHeight();
      Shape old = g2.getClip();
      a1 = new Area(new Rectangle2D.Double(0.D, 0.D, w, h));
      a2 = new Area(new Rectangle2D.Double(BORDER_SIZE, BORDER_SIZE, w,
                                           h - 2 * BORDER_SIZE));
      a1.subtract(a2);
      g2.clip(a1);
      for (int i = 0; i < w + 55; i += 4) {
        g2.drawLine(i, 0, i - 55, (int) h);
      g2.setClip(old);
}The idea is to draw diagonal lines over the whole are of the component and only show the lines in the clipping area a1.
I have see those kinds of borders many times in legacy apps.
The line drawing might be expensive and the allocation of the Area objects too.
Any ideas?
regards.
Olek

Line drawing is not expensive, but operations on Area and clipping against complex shapes are. You can compute the clipped segments yourself based on the two rectangles, without going through this expensive mechanism. The code will be a little less readable, but a whole lot faster.

Similar Messages

  • How to find a customer who does not have any activity in the last 5 years

    HI all,
       How to find a customer who does not have any activity in the last 5 years.
    Thanks & Regards,
    Moderator message: not directly related to ABAP development, please have a look in the respective functional forum.
    Edited by: Thomas Zloch on Jan 3, 2011 2:20 PM

    Post Author: tzinser
    CA Forum: Formula
    Okay, I left off a lot of important information...
    I'm using two tables
    TWDATA
    EVENT
    From TWDATA I'm pulling the fields TWDATA.OrderNumber and TWDATA.DisbursementDate
    From EVENT I'm pulling the fields EVENT.EventCode and EVENT.CompletedDate
    The two tables are linked by OrderNumber.

  • How to Block user from Sending IM or Hide Presence of there user who is not in his department

    Hi All,
    How to Block user from Sending IM or Hide Presence of there user who is not in his department.
    Thank you

    Hi Jp,
    Method 1:
    You can use the Enhanced Privacy Mode in Lync 2013
    <section class="ocpSection">
    Enable Privacy Mode
    By default, everyone except Blocked Contacts can see your presence status. To modify the privacy settings, you can do the following:
    In the Lync main window, click the Options button.
    In the Lync - Options dialog box, click Status, and then do one of the following:
    Click I want everyone to be able to see my presence regardless of system settings (override default settings).
    Click I want the system administrator to decide - currently everyone can see my presence but this could change in the future.
    </section>
    About Enhanced Privacy Mode
    If your organization has enabled Enhanced Privacy Mode in Lync, you can choose whether to limit visibility of your presence information to only those people you’ve added to your Contacts list. You do that by selecting one of the following on the
    Options->Status window:
    I want everyone to be able to see my presence
    I only want people in my Contacts list to see my presence
    Method 2:
    Using Privacy Relationship, you can block a particular user by adding him to blocked contacts
    Anil Kumar (MCITP)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • If a group message doesn't completely go through, how can I see who did not recieve it?

    I tried to send a mass text message (note: I have group messaging turned OFF, but I just used the field where you can send the same message to multiple recipients), however, it came back saying that "Your message was not sent. Tap "Try Again" to send this message." I know that some people recieved the text, as they replied to it, however I'm fairly certain that one or two people did not recieve it. Is there any way to figure out who did not correctly get the message from within the app? Thanks.

    Change your password, alert your credit card company and itunes support.

  • I recently bought an iphone 4s from people who are not in the know and restore my iphone .. Now do not be in use for not having ID and password ... Owner apple owner just gave me a serial number how do I want to continue to use this ... Their telephone he

    I recently bought an iphone 4s from people who are not in the know
    and restore my iphone .. Now do not be in use for not having ID and password ... Owner apple owner just gave me a serial number how do I want to continue to use this ... Their telephone help me: (

    I am having same problem . i can not use the phone. my Carrier ROGERS checked the phone its not stolen or lost phone but after restoring always ask for apple ID of previous owner and seller is not responding to any mails or phone if some one can help me out than it will be great.
    thank you

  • If I want to add a family member who is not in my household and has their own itunes account and credit info...

    If I want to add a family member who is not in my household and has their own itunes account and credit info...will all their purchases be charged to my credit card as the Organizer?

    Hi mbostick, 
    Welcome to the Apple Support Communities!
    The only way a family member can use their own funds and not the Organizer’s account for purchases would be with store credit, such as an iTunes gift card. 
    Family purchases and payments
    Making purchases
    After you set up your family, any time a family member initiates a new purchase it will be billed directly to your account unless that family member has gift or store credit. First, their store credit will be used to pay the partial or total bill. The remainder will bill to the family organizer. As the family organizer, any receipts generated by the transaction will be sent to you. Learn more about how iTunes Store purchases are billed.
    Have a great day,
    Joe

  • How to get a list of Local Users who has not logged in for 3 months or around 90 days

    hi
    i found this thread to pull out a list of local users
    Retrieve all local user accounts information on remote computers (PowerShell)
    however, i need to filter out users who has not logged in for 3 months or around 90 days, how can i do further filtering?
    i understand dsquery has an -inactive <xweeks> , however i am doing it for local accounts

    $ErrorActionPreference = "silentlycontinue"
    $([ADSI]"WinNT://$env:COMPUTERNAME").Children | where {$_.SchemaClassName -eq 'user' -and $_.lastLogin -gt (Get-Date).AddDays(-90)} | ft name,lastlogin
    using the sample from the link extendend with the 90 days criteria, the erroraction preference surpresses the errors you get for accounts with no lastlogon value (guest being a typical one)

  • Goodnight. as you know apple has evolved considerably until today but there are people who do not have ability to buy new products. in my case I would like to know why the apple do not let the iphone 3g update to iOS 4.3 as are several applications that c

    goodnight. as you know apple has evolved considerably until today but there are people who do not have ability to buy new products. in my case I would like to know why the apple do not let the iphone 3g update to iOS 4.3 as are several applications that can not put on my iphone 3g due to this reason. Why does not Apple make a repository with applications for ios 4.2.1? or else do not work in an update to ios 4.3 on iphone 3g?

    This has nothing to do with Apple, as Apple does not make the apps.
    This is the decision of the app maker.
    Contact those app makers and ask them why they do this.

  • Is there anyone who is not having a problem with their Fascinate?

    Just ordered the Fascinate for a penny from Amazon. Looks like that's all it's worth! LOL. Is there anyone who has not had problems with this phone! I have not received mine yet, maybe I'll be one of the lucky ones.
    Should I do the update or stick with 2.1? Do I have a choice?

    2.2.1 is Froyo. The phone originally shipped with 2.1 Eclair. What is your Build number? I'm assuming it is not the ED04 (which you should avoid at all costs) since you were prompted to update.
    Edit: Also, I don't know if it works the same way on the Fascinate, but on the Droid X (running unrooted stock software) you could only postpone the update for a certain period of time and then it would force the update without your approval. Broke a lot of people's X's that were previously running fine. Hope that doesn't happen to you but just letting you know it's possible.

  • Best practice on how to handle employees who do not have a last name?

    We are a Canadian based company with some International employees. We have recently begun to enter the International employees into the HR module. This has led to some problems for employees from India who do not have both a first name and a last name as many of our downstream systems require both names.
    I'm wondering what other companies with International employees have done in this circumstance. Can someone recommend a Best Practice?  We want to ensure that whatever we do is not offensive to anyone.
    Thanks.

    Dear,
    Indian names vary from region to region. Sometimes Names also influence by religion and caste. Different languages spoken in India in different regions. This variety makes confusing differences in names and their styles.
    Now come to the point, since you are international company, while entering the names of your international employees - i would like to suggest to consider the employees names as mentioned in their passport (If they hold valid passport). In case of non availability of passports consider their bank information or any other available information so that they didnt face any further problems like visa, banking transactions etc etc.
    1. Maddepalli Venkata Ramana Rao
    In this case Maddepalli will be his surname, Venkata Ramana can be his first name and Rao can be mentioned as Second / last name.
    2. Hardev Singh
    In this case you didnt find a surname... Singh will be considered as Surname or his ethinic recognition. In this case you can enter Hardev as First name and Singh as last name.
    Make some entry fields are optional depending on the situation. Take help of an Indian origin employees help exists in your office.
    Regards,
    Syed Hussain.

  • How do you find out who did not contribute to a particular fund raiser that we all just did?

    Using MYsql How do you find out who did not contribute to a particular fund raiser that we all just did. There are many titles to the different charities that is under the othpaytitle of the Otherpay table,  I however just want to extract the non-contributors for a particular charity title. Is there anyway to do this? When I do the the syntax below it comes up as an "empty set". The search is done by way of the table Id matching and left joins. Please see below.
    SELECT  moiid, trim(concat(name.fname,' ' ,name.mname,' ',name.lname)) as Brother, name.moiid as Members_ID, sum(otherpay.othpayamt) as NO_Contribution, quadlt.ltfname as quad 
    FROM name 
    LEFT JOIN OTHERPAY  ON name.moiid = otherpay.othpaymoiid
    LEFT JOIN quadlt  ON name.quadlt = quadlt.ltid
    WHERE  Otherpay.othpaytitle like '%food drive%'
    AND otherpay.othpaymoiid IS NULL
    AND name.type = 'BOI'
    AND name.type <> 'jrboi'
    AND name.city = 'SUFFOLK'
    GROUP BY brother
    ORDER BY name.quadlt, brother

    Just guessing based on your query,  and assuming the above query works, just insert a "where" condition. I also removed the SUM function. Also, "AND otherpay.othpaymoiid IS NULL"  may not be needed.
    SELECT  moiid, trim(concat(name.fname,' ' ,name.mname,' ',name.lname)) as Brother, name.moiid as Members_ID, otherpay.othpayamt, quadlt.ltfname as quad
    FROM name 
    LEFT JOIN OTHERPAY  ON name.moiid = otherpay.othpaymoiid
    LEFT JOIN quadlt  ON name.quadlt = quadlt.ltid
    WHERE  Otherpay.othpaytitle like '%food drive%'
    AND otherpay.othpaymoiid IS NULL
    AND name.type = 'BOI'
    AND name.type <> 'jrboi'
    AND name.city = 'SUFFOLK'
    AND othpayamt=0
    ORDER BY name.quadlt, brother

  • Display XML Idoc for people who do not understand XML

    Hi,
    does anybody know an easy way to make an Idoc XML readable for people who do not have any knowledge about XML?
    This request comes from our sales department. We store incoming ORDERS.ORDERS05 Idocs from customers in XML format on a file server before mapping and sending them into an R/3 system to create the sales orders. For some reason, the sales people in our company sometimes have to have a look at the original incoming file.
    Our intension is to give them an easy tool to open the Idoc XML and get it displayed in a more or less clearly arranged way, maybe as HTML table or something similar. Unfortunately I am not too familiar with XSLT.
    Any ideas?
    Thanks,
    Philipp

    Hi Philipp,
    you need to do some kind of transformation. XSLT would be my first idea, but if you are not familiar with it, it might be worth a try to have a look at graphical report generators. They will take the hassle of doing manual coding from you.
    Or there are XSLT mapping tools available which allow you to transform from XML to HTML, doing basically the same thing.
    I do not know if I am allowed to supply some product names here, but I guess a google query for "report generator" or "xslt mapping tool" will yield some results.
    Cheers!
    Stefan

  • I have an ipad 1 that I plan to give to a friend who does not have an apple computer.  Will he be able to use it once I have cleared my personal information?

    I plan to give my ipad to a friend who does not have an Apple computer once I have cleared my personal information.  Will he be able to set it up without iTunes?

    You're welcome. He can find it here:
    http://support.apple.com/downloads/

  • Sending notification for a person who is not a part of the WF

    Hellow experts,
    Does anyone know how can I send a massage from the CUP for a person who is not a part of the WF?
    (Approval of a role creation and a standard WF in the CUP)
    I want to inform a person in one of the stages. I don't want this person to take a part in the WF process.
    Thank you,
    Shira

    All,
    Amol is correct as you can specify groups to be the recipiant for workflows however, that will include them in the workflow path.
    The other options would be to assign additional users into the Cad for information purposes but not assign them permissions to approve requests.
    Or maintain the email address in the UME with the distribution list email rather than a specific user's own address. I wouldn't recommend this though as it could really screw up your master data maintenance!
    Simon

  • Is it okay to home share with my roommate who is not related to me if we do not import each other's music?

    Is it okay to home share with my roommate who is not related to me if we do not import each other's music?

    Thanks I will try that . . . . the issue became worse when we recently updated to IOS6 - now all three of us get everything . . . . I was trying to avoid separate Apple ID's and emails but that might be the solution based on what I have read on here . . . .

  • Address Book Suggestion: See who is NOT in a Group

    I recently moved all of my contacts from Entourage to the Address Book in OS X, and am very happy with it. On top of the ease of use of the Address Book, its integration with MobileMe and the iPhone is wonderful.
    As I organized and updated my 300+ contacts, I began to sort them into Groups. I quickly found that I could move people to the group easily, but I had a hard time remembering who was NOT in that group already.
    I would like to suggest adding a view or filter to see who is NOT in a given group. That way, you can quickly scan your list of contacts, and add any that are missing, completing the group.
    Thank you!

    This would work for contacts that are only in one group, but some are in more than one - rather than creating a smart group for every group (doubling the number of groups I have), I would like to suggest this be a feature of the Address Book app, much like how Home Sharing in iTunes 9 will tell you what music is NOT in your current library, so you can choose to import it.

Maybe you are looking for

  • Problem with String in JSP! Help Me

    Hi all, i spent my whole day with this error. How can i solve it. I am trying to convert a string array to Integer array. The program is taking all the select input from the previous JSP page and then converting them into integer array for storing to

  • Usb to Serial port adapter

    I have a gilsson usb to serial port bi directional adapter cable which uses the Prolific pl-2303 chipset. I am attempting to use this cable to interface a Mac Mini with a Harsper PDP plasma television. I am attempting to control the functions of the

  • Adobe Reader 10.1.2

    I just updated Adobe Reader 9.5.0 to 10.1.2, no problem. I work on a Windows 7 computer. I can open saved PRF files on my computer, no problem. I was on line and wanted to print a receipt and got the following error message- Problem with Adobe Acroba

  • What is "other" on iphone sync? How to free up space?

    Upgraded to Lion, iOS5, and cloud. Now I can't sync iPhone. Half the space is "other". How can I free up the space?

  • MetaData Repository in SAP BW

    Hi, I am from SAP BW. Actually, we used to create transformation and docement it. But documenting with lot of flows is tough so we used meta data repository. But meta data reporsitory only shows mapping between two objects like datasource to isnforso