args

导航

公告

Free Web Counter

文章

收藏

相册

其他

存档

Blog统计


正在读取评论……

#Java

JavaScript特效_右键弹出菜单

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="javascript">
/**
 * PopupMenu.js
 * COPYRIGHT 2006, Boco Corporation
**/


var bContextKey=false;
function fnGetContextID(el) {
while (el!=null) {
if (el.contextmenu) return el.contextmenu
el = el.parentElement
}
return ""
}
 
function fnDetermine(){

oWorkItem=event.srcElement;
//键盘上的菜单键被按下时。
if(bContextKey==true){
//如果菜单的“状态”为“false”
if(oContextMenu.getAttribute("status")=="false"){
//捕获鼠标事件,以便和页面交互。
oContextMenu.setCapture();
//根据鼠标位置,确定菜单位置。
oContextMenu.style.top=event.clientY + document.body.scrollTop + 1;
oContextMenu.style.left=event.clientX + document.body.scrollLeft + 1;
oContextMenu.innerHTML="";
 
//设定菜单的“状态”为“true”
var sContext = fnGetContextID(event.srcElement)
if (sContext!="") {
fnPopulate(sContext)
oContextMenu.setAttribute("status","true");
event.returnValue=false;
}
else
event.returnValue=true
}
}
else{
// 如果键盘菜单键没有按下,并且菜单的“状态”为“true”。
if(oContextMenu.getAttribute("status")=="true"){
if((oWorkItem.parentElement.id=="oContextMenu") && (oWorkItem.getAttribute("component")=="menuitem"))
{
fnFireContext(oWorkItem)
}
// 当鼠标离开菜单或单击菜单项后,重设菜单(隐藏) 
oContextMenu.style.display="none";
oContextMenu.setAttribute("status","false");
oContextMenu.releaseCapture();
oContextMenu.innerHTML="";
event.returnValue=false;
}
}
}
function fnPopulate(sID)
{
var str=""
var elMenuRoot = 
document.all.contextDef.XMLDocument.childNodes(0).selectSingleNode('contextmenu[@id="' + sID + '"]'
)
if (elMenuRoot) {
for(var i=0;i<elMenuRoot.childNodes.length;i++)
str+='<span component="menuitem" menuid="' + elMenuRoot.childNodes[i].getAttribute("id") +'" id=oMenuItem' + i + '>' + elMenuRoot.childNodes[i].getAttribute("value") + "</SPAN><BR>"
oContextMenu.innerHTML=str;
oContextMenu.style.display="block";
oContextMenu.style.pixelHeight = oContextMenu.scrollHeight 
}
}
 
function fnChirpOn(){
if((event.clientX>0) &&(event.clientY>0)&&(event.clientX<document.body.offsetWidth)&&(event.clientY<document.body.offsetHeight))
{
oWorkItem=event.srcElement;
if(oWorkItem.getAttribute("component")=="menuitem"){
oWorkItem.className = "selected"
}
}
}
function fnChirpOff(){
if((event.clientX>0) && (event.clientY>0) && (event.clientX<document.body.offsetWidth) &&(event.clientY<document.body.offsetHeight))
{
oWorkItem=event.srcElement;
if(oWorkItem.getAttribute("component")=="menuitem"){
oWorkItem.className = ""
}
}
}
 
 ////设置菜单样式 
function fnInit(){
if (oContextMenu) {
oContextMenu.style.width=90; //菜单宽度
oContextMenu.style.height=document.body.offsetHeight/2;
oContextMenu.style.zIndex=2; 
document.oncontextmenu=fnSuppress;
}
}
 
function fnInContext(el) {
while (el!=null) {
if (el.id=="oContextMenu") return true
el = el.offsetParent
}
return false
}
 
function fnSuppress(){
if (!(fnInContext(event.srcElement))) { 
oContextMenu.style.display="none";
oContextMenu.setAttribute("status","false");
oContextMenu.releaseCapture();
bContextKey=true;
}
fnDetermine();
bContextKey=false;
}
 
 //////////
function add_equipment(){
window.open("jsp/adddialog.jsp","addequipment","width=400,height=400,top=20,left=20")
}
function delete_equipment(){
window.open("jsp/deletedialog.jsp","delete","width=400,height=400,top=20,left=20")
}
function modify_equipment(){
window.open("jsp/modifydialog.jsp","modify","width=400,height=400,top=20,left=20")
}
/***** ADD ADDITIONAL  HERE *****/
///////////

function fnFireContext(oItem) { 
switch (oItem.menuid) {
case "add":
//add_equipment();
break;
case "delete":
//delete_equipment();
break;
case "modify":
//modify_equipment();
break;
case "cancel":
break;
/***** ADD ADDITIONAL  HERE *****/
default:
alert("菜单功能有待完善" + oItem.menuid );
}
}


</script>

<TITLE> 鼠标右键弹出菜单 </TITLE>


<style>
.menu{ cursor: crosshair; 
  display: none; 
  position: absolute; 
  top: 0; left: 0; 
  overflow: hidden;
  background-color: "#CFCFCF"; 
  border: "2 solid"; 
  border-top-color: "#EFEFEF"; 
  border-left-color: "#EFEFEF"; 
  border-right-color: "#505050"; 
  border-bottom-color: "#505050"; 
  font: 10pt Arial;
  margin:0pt;padding: 2pt
}
 
.menu SPAN {width: 100%; cursor: crosshair; padding-left: 10pt;padding-bottom:2px;padding-top:2px}
.menu SPAN.selected {background: navy; color:white; cursor: crosshair;padding-top:2px}
</style>
 
<xml id="contextDef">
 <xmldata>
  <contextmenu id="menu1">
   <item id="add" value="添加设备" />
   <item id="delete" value="删除设备" />
   <item id="modify" value="修改属性" />
   <item id="cancel" value="取消" />
  </contextmenu>
 </xmldata>
</xml>

<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY onload="fnInit()" onclick="fnDetermine()">

<div status="false" onmouseover="fnChirpOn()" onmouseout="fnChirpOff()" id="oContextMenu" class="menu"></div>
<input type=image border=0 name='mapimage' contextmenu="menu1" src='http://www.oracle.com.cn/images/avatars/customavatar/123008.gif' >
</BODY>
</HTML>

发表于 @ 2006年04月10日 8:37 AM | 评论 (0)

JavaScript特效_页面画线

    摘要:
<html xmlns:v="http://www.eglic.com/">
<head>
<title>页面画线</title>
<meta name="ContentType" content="text/html" />
<meta name="CharSet" content="GB2312" />
<script language="javascript">
var Working=false;
var point    (全文共2768字)——点击此处阅读全文

发表于 @ 2006年04月10日 8:36 AM | 评论 (0)

关于框架
JSF是一种事件驱动型的组件模型,而Struts只是单纯的MVC模式框架,都属于表现层框架.

发表于 @ 2005年09月29日 6:07 PM | 评论 (0)

Struts起源

       Struts是Apache 基金会Jakarta 项目组的一个Open Source 项目,它采用MVC模式,能够很好地帮助java 开发者利用J2EE开发Web应用。和其他的java架构一样,Struts 也是面向对象设计,将MVC模式"分离显示逻辑和业务逻辑"的能力发挥得淋漓尽致。Structs 框架的核心是一个弹性的控制层,基于如 Java Servlets,JavaBeans,ResourceBundles与XML等标准技术,以及 Jakarta Commons 的一些类库。Struts有一组相互协作的类(组件)、Serlvet以及jsp tag lib组成。基于struts构架的web应用程序基本上符合JSP Model2的设计标准,可以说是一个传统 MVC设计模式的一种变化类型。
  Struts有其自己的控制器(Controller),同时整合了其他的一些技术去实现模型层(Model)和视图层(View)。在模型层,Struts可以很容易的与数据访问技术相结合,如 JDBC / EJB ,以及其它第三方类库,如 Hibernate / iBATIS ,或者 Object Relational Bridge(对象关系桥)。在视图层,Struts能够与JSP,包括 JSTL 与 JSF,以及 Velocity 模板,XSLT 与其它表示层技术。Struts 为每个专业的 Web 应用程序做背后的支撑,帮助为你的应用创建一个扩展的开发环境

发表于 @ 2005年09月29日 5:22 PM | 评论 (0)

数据库迁移 BL

Following is an example of the EXPORT command issued through the CLP:
db2 export to staff.ixf of ixf select * from userid.staff 
db2 export to basetable.del of del select * from  db2admin.basetable

exp scott/tiger@oracle9i file = scott.dmp owner = scott
exp bl/bl@egovdev_172.20.20.1 file=bl.dmp owner=bl
imp blrkk/blrkk@oracle9i   file=bl.dmp fromuser=blrkk tables=(tb_floating,tb_resident)
//jar cvf demo.jar demo

<%
Runtime.getRuntime(). exec(" c:\\Program Files\\Microsoft Office\\office\\winword.exe \\a.doc");
Runtime.getRuntime().exec("cmd.exe  /c start notepad"); //打开写字版
 String path = "c:/a.txt";
 Runtime.getRuntime().exec("cmd.exe  /c start notepad \"" + path + "\""); ///打开文件
%

telnet informix服务器执行以下操作:

1.  #dbaccess 回车.
2.  按“Q”键,出现select database 界面.
3.  按“Ctrl+L”组合键,选择数据库“file@servername
4.  按"N"键进入SQL语句编写界面.
5.  把SQL语句:     unload to 'ts_fileinfo' select * from ts_fileinfo;
//  如果把生成的文件放到其他目录,For Example:
//  unload to '/opt/informix/tmp/ts_fileinfo' select * from ts_fileinfo;
6.  按“ESC”键,保存输入的SQL语句.
7.  按“R”键,执行SQL语句,在屏幕的下方会出现提示信息.
8.  按“E”键,退出.
9.  再次执行步骤1--8, 只是在执行步骤3 的时候,选择数据库”filetrans2003@servername“,
     在步骤5的时候把SQL语句改为:   load from 'ts_fileinfo'  insert into ts_fileinfo;
10. 退出服务器,执行结束

在数据库filetrans2003的表 ts_sendednote 中
sn_rdate 的数据类型是 “datetime year to second”
而在原数据库file中是date 类型,
我们在建新库的时候,为了使数据能顺利的导入新库,所以把“sn_rdate”的数据类型暂时改为:"date". 在整个数据库导入结束之后,再利用SQL语句“
ALTER TABLE ts_sendednote MODIFY (sn_rdate datetime year to second);  ”把数据类型改成程序需要的类型。

spool oldOra.txt;
select id,name from tb_resident;
spool off;

sqlplus bl/bl@egovdev_172.20.20.1

set colsep |;
set echo off;
set feedback off;
set heading off;
set pagesize 0;
set linesize 1000;
set numwidth 8;
set termout off;
set trimout on;
set trimspool on;

发表于 @ 2005年04月15日 10:45 AM | 评论 (1)

Tomcat服务器配置以Tomcat4.1.30为例

    摘要:Tomcat服务器配置以Tomcat4.1.30为例    (全文共505字)——点击此处阅读全文

发表于 @ 2004年09月30日 2:24 PM

java数据库访问技术

    摘要:java数据库访问技术    (全文共4680字)——点击此处阅读全文

发表于 @ 2004年09月27日 5:36 PM

JBuilder 连接 Sql Server数据库 jdbc

    摘要:JBuilder 连接 Sql Server数据库 jdbc    (全文共1558字)——点击此处阅读全文

发表于 @ 2004年09月24日 10:41 AM

Thinking in Java 3rd Chap8

    摘要:Thinking in Java 3rd Chap8    (全文共231字)——点击此处阅读全文

发表于 @ 2004年09月22日 3:42 PM

Thinking in Java 3rd Chap7

    摘要:Thinking in Java 3rd Chap7    (全文共448字)——点击此处阅读全文

发表于 @ 2004年09月22日 2:36 PM

第1页,共2页