Suspend 2 Ram Guide (Like MS Sleep Feature in Windows)

Suspend 2 Ram Guide
Requirements:
1.Kernel 2.6.* with Sleep States
Power Management Opitions -> Acpi -> Sleep States
2.Vbetool
I think any 2.6.* kernel will work I am not sure
Setup:
1. Make sure you have a kernel with Sleep States Compiled in. Any arch stock kernel should do.
2. pacman -S vbetool
Making the Script:
You now need to make a script that will unload your modules, save the video card state, restore modules on resume, etc....
Here is my script hopefully it pretty straight foward:
#!/bin/sh
# Initiates a suspend-to-ram!
# Suspend
echo "Going to sleep at `date`"
##Let's go to Terminal 1 (Ctrl+Alt+1)
echo "* chvt 1"
/usr/bin/chvt 1
##Close Programs
##I have session saver for firefox
if [ `pidof firefox-bin` ] ;
then killall firefox-bin ;
else echo "Firefox-bin is not running";
fi
##The Sound Module won't unload when applications are using the sound
killall xmms
if test -e /var/run/daemons/mpd.pid ;
then /etc/rc.d/mpd stop;
else echo "Mpd is not Running" ;
fi
## Stopping the Network
if test -e /var/run/daemons/network ;
then /etc/rc.d/network stop;
else echo "Network is not Running";
fi
##Save Alsa Mixer Settings and give all the programs 2 secs to finish shutting down.
alsactl store
sleep 2
## Unload Modules [snd_emu10k1 = sound 8139too = network]
rmmod snd_emu10k1
rmmod 8139too
#Save Video State
echo "* save vbestate"
/usr/sbin/vbetool vbestate save > /etc/acpi/vbestate
echo "* writing to /sys"
echo -n "mem" > /sys/power/state
echo ""
# Resume
echo "Back from sleep at `date`"
##Restore the state of the Video
echo "* restore vbestate"
/bin/cat /etc/acpi/vbestate | /usr/sbin/vbetool vbestate restore
##Lets restore the clock
echo "* restore clock"
/sbin/hwclock --hctosys
##Lets get back to Xorg (Ctrl+Alt+1)
echo "* chvt 7"
/usr/bin/chvt 7
##Load Modules
modprobe snd_emu10k1
modprobe 8139too
##Give the modules some time to learn
sleep 5
##Load Programs
/etc/rc.d/network start
alsactl restore
/etc/rc.d/mpd start
echo "* done"
echo ""
# Done
exit 0
You must edit this script if you want to use it!!!
The chance that you have the same modules and setup as me are extremely slim.
Note: Firefox uses the sound module and prevents unloading of it.

littleshoulders,
roam,
I have read all 221 messages in the "sticky" thread about DU, and followed Mac Fool's advice (and that in Apple's Article).
I have iTunes 7.0.2, and QuickTime 7.1.5.
This time, the "Repairing" ran all the way without a problem. It gave a couple of errors (one about /Library and one about /ColorSync - if I remember correctly). So, it is indeed something with iTunes.
I had 96 pkg's in /Receipts. I put all of them in the trash, except iTunesX.pkg. I do not have iTunesPhoneDriver.pkg. Do I delete all those pkg's, or should I put them back, "just in case"? I have no idea "in case what", though
Your thread does not state any maintenance or
troubleshooting that you have done already (other
than the aforementioned Repair Disk from your install
disk) so you may also wish to post back and let users
know if you have tried any others as of yet such as:
Are the cron maintenance routines run on the
machine?
I had no idea how to fix the weird things that I have been seeing in the past weeks/months. I also do not have any other maintenance applications installed/running. I guess I should, shouldn't I?...
About those cron routines. I remember reading, long ago, that they will not run when a Mac is in "sleep mode".
Is that true?
So, I can/should not put my Mac in sleep mode at night? But is it not a little "crazy" to have your Mac running the whole night?
I will have to read up on those cron tasks again.
Someone called Gulliver wrote a message about maintenance: guess I will start there.
Are those other maintenance app's advisable?
Perhaps a "OS X Maintenance for dummies"-book would be handy.
and having a too full HD can create alot of problems
so if you can post back how much free space you have
left might help.
I checked it:
Macintosh HD
Created : August 31, 2004
Structure: Mac OS Extended (Journaled)
Capacity: 74.4 GB
Available: 47.08 GB
Used: 27.31 GB free
So, that makes 37% used. That seems to be not that very much to cause performance issues?

Similar Messages

  • I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    You can type the email using what you set in preferences and then highlight the text and use command - minus sign (or command - + for larger) to reduce the size of the text.
    You can also type command - T and a window will appear allowing you to select fonts/sizes/color/ background highlight.
    The above works in Notes also. I haven't tried to do this in any other Apple application.
    For incoming emails, you can use the above to reduce font size, but I don't know of a way to permanently set the incoming font size to a default.

  • I can` t cut my Iphone off or rebout it i`ve held down the sleep button and home buttom, but it like the sleep buttom is stuck.

    I can1t cut mt Iphone 4 off or rebout it. I`ve held the sleep buttom and home buttom down for 15 seconds and the voice control screen comes up. Its like the sleep buttom is stuck. Has anyone else had this problem?

    Thanks so much - didn't even occur to me.  Deleted everything that arrived in the half hour when it started happening and hey presto, problem is fixed.  Thank you Texas!
    Vicky

  • Have 2 iPads and 2 i phones and a late 2006 Mac with 2G dual port processors and 3 G RAM, Need lion to utilize features of iCloud features of linking all devices.  currently runing 10.6.8 with no problem. Is it likely that Lion will work for me?

    Have 2 iPads and 2 i phones and a late 2006 Mac with 2G dual port processors and 3 G RAM, Need lion to utilize features of iCloud linking all devices. Currently running 10.6.8 with no problem. Is it likely that Lion will work for me or am I asking to much from the Mac?
    Jimbo

    astrojimbo wrote:
    Is it likely that Lion will work for me or am I asking to much from the Mac?
    As long as it meets the minimum technical specifications, although the more above the minimum you have, the better the experience.

  • Creating a pop-down using a range of cells (Like Excel LIST feature)

    Can this be done in numbers. Instead of typing the data into a pop-up list to be pasted in an ongoing long spreadsheet, I was wondering if Numbers supports a similiar feature to Excel's MANAGE LISTS which allows the drop down to be locked to a range of cells instead. I know they are very similar, but wondering?
    -Kevin

    Kevin,
    Presently Drop-Down menu's can't be created from cell ranges in Numbers. It sounds like a good feature, and has been asked about many times here. You can Send Feedback to the Numbers team and tell them what you would like to see in the next version of Numbers. The Feedback link is under the Numbers menu item.
    Jerry

  • Looking to run windows on my MBPro through Bootcamp or Parallels, but would like to use a downloaded Windows 7, is it possible to install without the Windows Disc?

    Looking to run windows on my MBPro through Bootcamp or Parallels, but would like to use a downloaded Windows 7, is it possible to install without the Windows Disc?
    Need to set up a workstation on my MBPro that will only run on Windows. Im willing to use Bootcamp or Parallels to see what works best. Need to get this set up this week to enable working from home on my MB - rural and hoping to buy Windows 7 online - am I able to get windows working through either bootcamp or Parallels without the actual Windows disc? Bootcamp set up guide calls for a disc.

    Welcome to Apple Support Communities
    First, the answer to your question is yes, it IS possible to install Windows in Parallels without a disc, using an .iso image file.
    Boot Camp since OS X 10.8 also installs Windows without a disc: https://discussions.apple.com/thread/4889551?tstart=0
    Parallels has complete documentation, series of forums, and a knowledgebase. You can also download the current release of Parallels 9 and try it for free for a few weeks before you decide to purchase it.
    The Parallels Desktop for Mac product page: http://www.parallels.com/products/desktop/
    The Desktop for Mac forums: http://forum.parallels.com/forumdisplay.php?58-Parallels-Desktop-for-Mac
    Documentation: http://www.parallels.com/support/desktop-virtualization/desktop/#c12970
    The Knowledgebase for Desktop for Mac: http://kb.parallels.com
    The primary difference between a Boot Camp installation and a Parallels installation is that in the Boot Camp installation, you're installing Windows into a separate partition on your internal mass storage device (hard drive or SSD) and then rebooting your Mac directly into Windows.
    In Parallels, you're always running OS X on the Mac and Parallels is running a Windows virtual machine.
    Not to get too technical here, but it is also possible for Parallels to run an installed Windows Boot Camp partition as a virtual machine. If you're evaluating system performance with a trial copy, that might be the way to go, because you only have to install Windows once on Boot Camp as a dual-boot system, then install Parallels Desktop and run the Boot Camp partition as the virtual machine.
    There is a performance difference between the two, with the Boot Camp Windows installation being faster, but without the convenience of running both Mac and Windows applications simultaneously offered by Parallels. Sometimes that convenience outweighs a performance hit.
    I can't give you more Mavericks and Parallels 9 specifics, because I'm currently running Windows 7 with Parallels 7 on OS X 10.8.5. Parallels 7 will not run on OS X 10.9 Mavericks.
    I've been using Parallels (to run a few old rarely-used WIndows applications with features that would require a steep learning curve and major expense to purchase and learn a similar Mac app) occasionally since Parallels 3 and Windows XP. With each new release of OS X, each new release of Parallels, and each new Windows release, there are ALWAYS 'early adopter' bugs that get worked out over time.
    Message was edited by: kostby

  • Elitebook 840 G1 Sleep Wakeup Issues Windows 10

    Hello AllI have an HP Elitebook 840 G1. I've recently installed Windows 10 x64 enterprise edition.I noticed that why my Laptop goes to sleep mode or I put it in sleep mode it doesn't wake up properly.the hardware wakes up, the hard disk shows data is getting processed but screen doesn't show anything. after few minutes the system completely restarts. I've updated all the windows updates.unfortunatly, there is something wrong with HP website when you search for driver/BIOS updates. previously it use to show a lot of components which BIOS was one of them. But now when I search i hardly get only four drivers. Can anyone help.

    Power Efficiency Diagnostics ReportComputer NameMCT-ICT-001Scan Time2015-08-06T09:38:46ZScan Duration60 seconds System ManufacturerHewlett-PackardSystem Product NameHP EliteBook 840 G1BIOS Date03/24/2015BIOS VersionL71 Ver. 01.31OS Build10240Platform RolePlatformRoleMobilePlugged IntrueProcess Count86Thread Count1313Report GUID{6abdb12f-be4a-4ee0-961c-7822eacb3c6c} Analysis ResultsErrorsPower Policyleep timeout is disabled (On Battery)The computer is not configured to automatically sleep after a period of inactivity.Power Policyleep timeout is disabled (Plugged In)The computer is not configured to automatically sleep after a period of inactivity.CPU Utilizationrocessor utilization is highThe average processor utilization during the trace was high. The system will consume less power when the average processor utilization is very low. Review processor utilization for individual processes to determine which applications and services contribute the most to total processor utilization.Average Utilization (%)14.65Platform Power Management CapabilitiesCI Express Active-State Power Management (ASPM) DisabledPCI Express Active-State Power Management (ASPM) has been disabled due to a known incompatibility with the hardware in this computer.Device Drivers:Devices with missing or misconfigured drivers can increase power consumption.Device NameUnknown DeviceDevice IDACPI\HPQ6007\3&33FD14CA&0Device Status0x1802400Device Problem Code0x1cWarningsPlatform Timer Resolutionlatform Timer ResolutionThe default platform timer resolution is 15.6ms (15625000ns) and should be used whenever the system is idle. If the timer resolution is increased, processor power management technologies may not be effective. The timer resolution may be increased due to multimedia playback or graphical animations.Current Timer Resolution (100ns units)10007Maximum Timer Period (100ns units)156250Platform Timer Resolutionutstanding Timer RequestA program or service has requested a timer resolution smaller than the platform maximum timer resolution.Requested Period10000Requesting Process ID4944Requesting Process Path\Device\HarddiskVolume1\Program Files (x86)\Hewlett-Packard\HP Support Framework\HPSF.exeCPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process NameHPDObject.exePID1296Average Utilization (%)8.64ModuleAverage Module Utilization (%)\Device\HarddiskVolume1\Program Files (x86)\Hewlett-Packard\HP Support Solutions\Modules\ActiveCheck\HPDObject.exe8.60\SystemRoot\system32\ntoskrnl.exe0.01\Windows\SysWOW64\msxml3.dll0.00CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process NameMsMpEng.exePID2276Average Utilization (%)1.00ModuleAverage Module Utilization (%)\Device\HarddiskVolume1\ProgramData\Microsoft\Windows Defender\Definition Updates\{EF797E8C-B8E9-428C-8E86-2B000CF5FD94}\mpengine.dll0.67\Device\HarddiskVolume1\Windows\System32\ntdll.dll0.15\SystemRoot\system32\ntoskrnl.exe0.07CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process NameHPSF.exePID4944Average Utilization (%)0.99ModuleAverage Module Utilization (%)\Device\HarddiskVolume1\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\wpfgfx_v0400.dll0.22\SystemRoot\system32\ntoskrnl.exe0.14\Device\HarddiskVolume1\Windows\System32\igdumdim64.dll0.12CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process NameSystemPID4Average Utilization (%)0.46ModuleAverage Module Utilization (%)\SystemRoot\system32\ntoskrnl.exe0.25\SystemRoot\System32\drivers\dxgmms2.sys0.09\SystemRoot\system32\DRIVERS\igdkmd64.sys0.07CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process Namesvchost.exePID928Average Utilization (%)0.34ModuleAverage Module Utilization (%)\Device\HarddiskVolume1\Windows\System32\sysmain.dll0.16\SystemRoot\system32\ntoskrnl.exe0.16\Device\HarddiskVolume1\Windows\System32\msvcrt.dll0.00CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process NameHPSupportSolutionsFrameworkService.exePID3960Average Utilization (%)0.24ModuleAverage Module Utilization (%)\SystemRoot\system32\ntoskrnl.exe0.08\Device\HarddiskVolume1\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll0.05\Device\HarddiskVolume1\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll0.02CPU Utilization:Individual process with significant processor utilization.This process is responsible for a significant portion of the total processor utilization recorded during the trace.Process Nameunzip.exePID6460Average Utilization (%)0.21ModuleAverage Module Utilization (%)\SystemRoot\system32\ntoskrnl.exe0.09\SystemRoot\System32\Drivers\NTFS.sys0.03\SystemRoot\System32\drivers\FLTMGR.SYS0.01InformationPlatform Timer Resolution:Timer Request StackThe stack of modules responsible for the lowest platform timer setting in this process.Requested Period10000Requesting Process ID4944Requesting Process Path\Device\HarddiskVolume1\Program Files (x86)\Hewlett-Packard\HP Support Framework\HPSF.exeCalling Module Stack\Device\HarddiskVolume1\Windows\System32\ntdll.dll \Device\HarddiskVolume1\Windows\System32\kernel32.dll \Device\HarddiskVolume1\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\wpfgfx_v0400.dll \Device\HarddiskVolume1\Windows\System32\kernel32.dll \Device\HarddiskVolume1\Windows\System32\ntdll.dllPower Policy:Active Power PlanThe current power plan in usePlan NameOEM Balanced Plan GUID{381b4222-f694-41f0-9685-ff5bb260df2e}Power Policyower Plan Personality (On Battery)The personality of the current power plan when the system is on battery power.PersonalityBalanced Power Policy:Video Quality (On Battery)Enables Windows Media Player to optimize for quality or power savings when playing video.Quality ModeBalance Video Quality and Power Savings Power Policyower Plan Personality (Plugged In)The personality of the current power plan when the system is plugged in.PersonalityBalanced Power Policy:802.11 Radio Power Policy is Maximum Performance (Plugged In)The current power policy for 802.11-compatible wireless network adapters is not configured to use low-power modes.Power Policy:Video quality (Plugged In)Enables Windows Media Player to optimize for quality or power savings when playing video.Quality ModeOptimize for Video Quality System Availability Requests:Analysis SuccessAnalysis was successful. No energy efficiency problems were found. No information was returned.USB Suspend:Analysis SuccessAnalysis was successful. No energy efficiency problems were found. No information was returned.Battery:Battery InformationBattery ID01857 2014/03/14Hewlett-PackardPrimaryManufacturerHewlett-PackardSerial Number01857 2014/03/14ChemistryLIonLong Term1Sealed0Design Capacity47561Last Full Charge47561Platform Power Management Capabilitiesupported Sleep StatesSleep states allow the computer to enter low-power modes after a period of inactivity. The S3 sleep state is the default sleep state for Windows platforms. The S3 sleep state consumes only enough power to preserve memory contents and allow the computer to resume working quickly. Very few platforms support the S1 or S2 Sleep states.S1 Sleep SupportedfalseS2 Sleep SupportedfalseS3 Sleep SupportedtrueS4 Sleep SupportedtruePlatform Power Management Capabilities:Connected Standby SupportConnected standby allows the computer to enter a low-power mode in which it is always on and connected. If supported, connected standby is used instead of system sleep states.Connected Standby SupportedfalsePlatform Power Management Capabilities:Adaptive Display Brightness is supported.This computer enables Windows to automatically control the brightness of the integrated display.Platform Power Management Capabilitiesrocessor Power Management CapabilitiesEffective processor power management enables the computer to automatically balance performance and energy consumption.Group0Index0Idle State Count3Idle State TypeACPI Idle (C) StatesNominal Frequency (MHz)2701Maximum Performance Percentage100Lowest Performance Percentage27Lowest Throttle Percentage3Performance Controls TypeACPI Performance (P) / Throttle (T) StatesPlatform Power Management Capabilitiesrocessor Power Management CapabilitiesEffective processor power management enables the computer to automatically balance performance and energy consumption.Group0Index1Idle State Count3Idle State TypeACPI Idle (C) StatesNominal Frequency (MHz)2701Maximum Performance Percentage100Lowest Performance Percentage27Lowest Throttle Percentage3Performance Controls TypeACPI Performance (P) / Throttle (T) StatesPlatform Power Management Capabilitiesrocessor Power Management CapabilitiesEffective processor power management enables the computer to automatically balance performance and energy consumption.Group0Index2Idle State Count3Idle State TypeACPI Idle (C) StatesNominal Frequency (MHz)2701Maximum Performance Percentage100Lowest Performance Percentage27Lowest Throttle Percentage3Performance Controls TypeACPI Performance (P) / Throttle (T) StatesPlatform Power Management Capabilitiesrocessor Power Management CapabilitiesEffective processor power management enables the computer to automatically balance performance and energy consumption.Group0Index3Idle State Count3Idle State TypeACPI Idle (C) StatesNominal Frequency (MHz)2701Maximum Performance Percentage100Lowest Performance Percentage27Lowest Throttle Percentage3Performance Controls TypeACPI Performance (P) / Throttle (T) States

  • Windows 8 Add Features to Windows 8 Pro

    Hi,
    I have Windows 8 64-bit that was preinstalled on my laptop, now I want to upgrade to Windows 8 Pro 64-bit, I already have the license from my dreamspark account. My questions are, upgrading from Windows 8 to Windows 8 Pro, from the "add features",
    is there any danger of data loss (personal files) on the same partition as the Windows and from different partitions? What about the installed programs, such as Visual Studio, VirtualBox, Office, etc.?
    I beleive the answer to my question is, no, there isn't any kind of data loss. But I still would like confirmation from an advanced user who has already followed these steps.
    Another question is, what if my Windows 8 installed language is Portuguese, and I want to upgrade to Windows 8 Pro English?
    Thanks everyone for their answers in advance!

    Hi,
    Yes, the installed programs would be still available to use.
    Here is some reference: Add features to Windows 8.1 (Available in WIndows 8)
    You cannot upgrade or keep your Windows settings, personal files, or applications if you are performing a cross-language installation. You can only keep your personal files during a cross-language installation by using Windows 8 Setup.
    For more information for the upgrade paths, please see:
    Windows 8 and Windows 8.1 Upgrade Paths
    Hope this may help
    Best regards
    Michael Shao
    TechNet Community Support

  • Network loss when use sleep mode in windows 7

    Dear Expert
    I have problem about windows 7 as below,
    when I  use windows 7 Professional in Toshiba Notebook 
    1. A network being cut when it becomes the sleep mode.
    2. Have to restart the Notebook to connect Network again.
    I'm not sure that it is feature of Windows 7 or not?
    Could you please to help me solve problem ?
    Thank you

    Hi,
    Yes, clear "Allow the computer to turn off this device to save power" in the properties of network adapter\Power management as mentioned in the link provided by arnavsharma, and check if the issue persists.
    Yolanda Zhu
    TechNet Community Support

  • How to handle power managment features of Windows Vista

    Hi guys
    I searched a little bit in the Toshiba Technical Knowledge Base and found very interesting article about the power management features of Windows Vista.
    *[How to handle power management features of Windows Vista|http://aps2.toshiba-tro.de/kb0/HTD84026Q0000R01.htm]*
    The point is that you will not find a same Toshiba Power Saver tool on Vista like on the Windows XP notebooks and the power saver settings are a little bit hidden in the Vista Power Saver settings.
    But you can also control the certain options like Cooling Method or Power Saving Mode.
    I think this document could be interesting for some here in the forum!
    Greetings to all!

    Hi Jayjay
    Thanks for posting this here in the forum.
    Several days ago I searched for such further power option in Vista.
    This document was really, really helpful for me.
    Thanks again

  • Unistall hp office from programs and features in windows 7

    Can anyone tell me what to do to get a HP Officejet 6500  E709n   software to uninstall?  Nothing happens when I use the uninstall from programs and features in Windows 7 Control panel or from the HP start menu group.
    I have spent most of the day trying to fix printer instalation.
    I have done everything possible using different unistall programs.

    Hello @Coffee_18 , and welcome to the HP Forums!
    I can see you're having issues uninstalling. I'd like to help with that!
    I would recommend using the HP uninstall program to remove the software:
    Uninstalling the Printer Software
    If that doesn't work, I'd suggest running the Microsoft Fix It tool:
    Diagnose and fix printer and printing problems automatically
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Is there any guide lines how you can secure windows 7 gpo enable system services startup security settings?

    Is there any guide lines how you can secure windows 7 gpo enable system services startup security settings?
    For example like many do with Forefront Client Security Anti-Malware service, and there is lots of other service that you would like to have control over to get an secure and stable Windows 7.
    /SaiTech

    Hi, 
    Since there is no response from you, we considered that you have gotten what you want in previous post. 
    For further question, please don't hesitate to come back here and let's discuss again. 
    If you have any feedback on our support, please click here
    Kate Li
    TechNet Community Support

  • How can one browse between (like 5 or so) open windows in Safari?

    How can one browse between (like 5 or so) open windows in Safari?

    Hello ...
    Good information here for utilizing Safari features.
    Mastering Safari’s multi page tab system
    Carolyn

  • I open iWeb but the main window doesn't open/appear on screen. The little windows like the inspector and font windows appear. Can anyone help?

    I open iWeb but the main window doesn't open/appear on screen. The little windows like the inspector and font windows appear. Can anyone help?

    Try the following:
    1 - delete the iWeb preference file, com.apple.iWeb.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iWeb's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iWeb folder (Snow Leopard and Earlier).
    3 - launch iWeb and try again.
    NOTE:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • How to resize a custom tree node like you would a JFrame window?

    Hello,
    I am trying to resize a custom tree node like you would a JFrame window.
    As with a JFrame, when your mouse crosses the Border, the cursor should change and you are able to drag the edge to resize the node.
    However, I am faced with a problem. Border cannot detect this and I dont want to use a mouse motion listener (with a large number of nodes, I fear it will be inefficient, calculating every node's position constantly).
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Insets;
    import java.util.EventObject;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellEditor;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeSelectionModel;
    public class ResizeNode extends JPanel {
           AnilTreeCellRenderer2 atcr;
           AnilTreeCellEditor2 atce;
           DefaultTreeModel treeModel;
           JTree tree;
           DefaultMutableTreeNode markedNode = null;
         public ResizeNode() {
                super(new BorderLayout());
                   treeModel = new DefaultTreeModel(null);
                   tree = new JTree(treeModel);          
                  tree.setEditable(true);
                   tree.getSelectionModel().setSelectionMode(
                             TreeSelectionModel.SINGLE_TREE_SELECTION);
                   tree.setShowsRootHandles(true);
                  tree.setCellRenderer(atcr = new AnilTreeCellRenderer2());
                  tree.setCellEditor(atce = new AnilTreeCellEditor2(tree, atcr));
                   JScrollPane scrollPane = new JScrollPane(tree);
                   add(scrollPane,BorderLayout.CENTER);
         public void setRootNode(DefaultMutableTreeNode node) {
              treeModel.setRoot(node);
              treeModel.reload();
           public static void main(String[] args){
                ResizeNode tb = new ResizeNode();
                tb.setPreferredSize(new Dimension(400,200));
                  JFrame frame = new JFrame("ResizeNode");
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  frame.setContentPane(tb);
                  frame.setSize(400, 200);
                  frame.pack();
                  frame.setVisible(true);
                  tb.populate();
         private void populate() {
              TextAreaNode2 r = new TextAreaNode2(this);
               setRootNode(r);
               TextAreaNode2 a = new TextAreaNode2(this);
               treeModel.insertNodeInto(a, r, r.getChildCount());          
    class AnilTreeCellRenderer2 extends DefaultTreeCellRenderer{
    TreeBasic panel;
    DefaultMutableTreeNode currentNode;
      public AnilTreeCellRenderer2() {
         super();
    public Component getTreeCellRendererComponent
       (JTree tree, Object value, boolean selected, boolean expanded,
       boolean leaf, int row, boolean hasFocus){
         TextAreaNode2 currentNode = (TextAreaNode2)value;
         NodeGUI2 gNode = (NodeGUI2) currentNode.gNode;
        return gNode.box;
    class AnilTreeCellEditor2 extends DefaultTreeCellEditor{
      DefaultTreeCellRenderer rend;
      public AnilTreeCellEditor2(JTree tree, DefaultTreeCellRenderer r){
        super(tree, r);
        rend = r;
      public Component getTreeCellEditorComponent(JTree tree, Object value,
       boolean isSelected, boolean expanded, boolean leaf, int row){
        return rend.getTreeCellRendererComponent(tree, value, isSelected, expanded,
         leaf, row, true);
      public boolean isCellEditable(EventObject event){
        return true;
    class NodeGUI2 {
         final ResizeNode view;
         Box box = Box.createVerticalBox();
         final JTextArea aa = new JTextArea( 1, 5 );
         final JTextArea aaa = new JTextArea( 1, 8 );
         NodeGUI2( ResizeNode view_ ) {
              this.view = view_;
              box.add( aa );
              aa.setBorder( BorderFactory.createMatteBorder( 0, 0, 1, 0, Color.GREEN ) );
              box.add( aaa );
              box.setBorder( BorderFactory.createMatteBorder( 5, 5, 5, 5, Color.CYAN ) );
         private Dimension getEditorPreferredSize() {
              Insets insets = box.getInsets();
              Dimension boxSize = box.getPreferredSize();
              Dimension aaSize = aa.getPreferredSize();
              Dimension aaaSize = aaa.getPreferredSize();
              int height = aaSize.height + aaaSize.height + insets.top + insets.bottom;
              int width = Math.max( aaSize.width, aaaSize.width );
              if ( width < boxSize.width )
                   width += insets.right + insets.left + 3;     // 3 for cursor
              return new Dimension( width, height );               
    class TextAreaNode2 extends DefaultMutableTreeNode {  
         NodeGUI2 gNode;
         TextAreaNode2(ResizeNode view_) {     
              gNode = new NodeGUI2(view_);
    }

    the node on the tree is only painted on using the
    renderer to do the painting work. A mouse listener
    has to be added to the tree, and when moved over an
    area, you have to determine if you are over the
    border and which direction to update the cursor and
    to know which way to resize when dragged. One of the
    BasicRootPaneUI has some code that can help determine
    that.Thanks for replying. What is your opinion on this alternative idea that I just had?
    I am wondering if it might be easier to have a toggle button in the node that you click when you want to resize the node. Then a mouse-down and dragging the mouse will resize the node. Mouse-up will reset the toggle button, and so will mouse down in an invalid area.
    Anil

Maybe you are looking for

  • How can I print a greater number of songs on a cd jewel case insert.

    How can I get around the number of songs limit when printing a CD jewel case insert? I have a set list of 50 songs but iTunes will only print about 25. There doesn't seem to be any way to reduce the font size.

  • Regarding RV_INVOICE_CREATE

    Hi Experts i am using RV_INVOICE_CREATE fm to create billing document i am just passing my delivery number and some values like this CALL FUNCTION 'RV_INVOICE_CREATE'     EXPORTING       VBSK_I       = VBSK_I       WITH_POSTING = WITH_POSTING     TAB

  • New Retina Macbook pro 15 Haswell loud fan?

    I'm running a brand new 15" 2.3ghz 16gb, 500HD (of course shipped with Mavericks), anyway this sucker is LOUD, the fan fires up every time I do a photo import with Lightroom 5. My room-temperature is average and it's sitting on a cool table. I ran di

  • Problem in communicating with ports

    dear friend, i have written code for listing ports. code is listed below import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.Formatter; import org.smslib.helper.CommPortIdentifier; import org.smslib

  • Can video output be set to same as source so there is minimal rerendering (like VideoRedo)?

    I guess every time a video is rerendered there is a loss of quality. Is there a setting somewhere that allows output to be set as the same format as source and basically copy, not rerender, the unaltered frames.?